Include Hive operator NetworkPolicy in bundle/chart regeneration - #4019
Conversation
|
@dislbenn: GitHub didn't allow me to request PR reviews from the following users: dislbenn. Note that only stolostron members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds a conditional Hive operator NetworkPolicy Helm template. Bundle automation also copies Hive’s NetworkPolicy manifest into the output directory and returns code 3 when the source or copy operation fails. ChangesHive NetworkPolicy support
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The requested Hive NetworkPolicy bundle and conditional chart rendering are supported by the verified source, with no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Hive's hack/bundle-gen.sh reads config/operator/operator_netpol.yaml only to populate CSV data in OperatorHub mode; it never emits the NetworkPolicy as a standalone manifest in the generated bundle. As a result the Hive operator's NetworkPolicy was never picked up when regenerating the hive-operator Helm chart via 'make regenerate-charts-from-bundles'. Update gen-hive-bundle.sh to copy config/operator/operator_netpol.yaml directly from the cloned Hive repo into the bundle output directory (renamed to hive-operator-networkpolicy.yaml) so it flows through the existing bundle-to-chart tooling like any other manifest, picking up the standard Helm templating (networkPolicies.enabled guard, namespace substitution) automatically. Fails hard if the file is missing so a future rename/removal upstream is caught immediately. Also includes the resulting regenerated chart template. Signed-off-by: dislbenn <dbennett@redhat.com>
017c8db to
e5eba63
Compare
|
/cherry-pick backplane-5.0 |
|
@dislbenn: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dislbenn, ngraham20 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test sonar-pre-submit |
|
|
@dislbenn: new pull request created: #4021 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |



Description
Hive's
hack/bundle-gen.shreadsconfig/operator/operator_netpol.yamlonly to populate CSV data in OperatorHub mode; it never emits the NetworkPolicy as a standalone manifest in the generated bundle. As a result, the Hive operator's NetworkPolicy was never picked up when regenerating thehive-operatorHelm chart viamake regenerate-charts-from-bundles, unlike every other toggle component which ships its NetworkPolicy through the standard bundle-to-chart flow.Related Issue
N/A — found while auditing chart NetworkPolicy coverage across
pkg/templates/charts/toggle/.Changes Made
hack/bundle-automation/gen-hive-bundle.shto copyconfig/operator/operator_netpol.yamldirectly from the cloned Hive repo into the bundle output directory (renamed tohive-operator-networkpolicy.yaml) after the bundle manifests are copied.{{- if .Values.global.networkPolicies.enabled }}guard, namespace substitution) the same way other components (e.g.assisted-service) do.exit 3) if the file is missing upstream, so a future rename/removal inopenshift/hiveis caught immediately instead of silently dropping the NetworkPolicy.pkg/templates/charts/toggle/hive-operator/templates/hive-operator-networkpolicy.yaml.Screenshots (if applicable)
N/A
Checklist
Additional Notes
Verified end-to-end by running
hack/bundle-automation/gen-hive-bundle.shagainstopenshift/hivemaster: the extractedhive-operator-networkpolicy.yamlmatches Hive's sourceconfig/operator/operator_netpol.yamlexactly, and after running the chart regeneration tooling the file lands inpkg/templates/charts/toggle/hive-operator/templates/with the samenetworkPolicies.enabledguard and namespace templating pattern used by other components' NetworkPolicy templates. The existing NetworkPolicy controller (controllers/networkpolicy.go) picks up chart templates automatically, so no controller changes are needed.Reviewers
/cc
Definition of Done
Summary by CodeRabbit