Skip to content

fix: add NetworkPolicy to optional supported bundle resource types - #167

Merged
openshift-merge-bot[bot] merged 1 commit into
mainfrom
fix/add-networkpolicy-to-bundle-resource-types
Jul 28, 2026
Merged

fix: add NetworkPolicy to optional supported bundle resource types#167
openshift-merge-bot[bot] merged 1 commit into
mainfrom
fix/add-networkpolicy-to-bundle-resource-types

Conversation

@dislbenn

@dislbenn dislbenn commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Description

Add NetworkPolicy to optional_supported_bundle_resourceTypes so that NetworkPolicy resources in OLM bundle manifests are correctly copied into Helm chart templates during chart generation.

Related Issue

Follow-up to #164 and #165 which added NetworkPolicy helm conditional wrapping to chart generation.

Changes Made

  • Added NetworkPolicy to the optional_supported_bundle_resourceTypes list in bundles-to-charts.py
  • NetworkPolicy was already present in resource_kinds (used for template processing/wrapping) but was missing from the bundle copy allowlist, causing NetworkPolicy resources in bundle/manifests/ to be rejected as "unsupported" during the copy step

Screenshots (if applicable)

N/A

Checklist

  • I have tested the changes locally and they are functioning as expected.
  • I have updated the documentation (if necessary) to reflect the changes.
  • I have added/updated relevant unit tests (if applicable).
  • I have ensured that my code follows the project's coding standards.
  • I have checked for any potential security issues and addressed them.
  • I have added necessary comments to the code, especially in complex or unclear sections.
  • I have rebased my branch on top of the latest main/master branch.

Additional Notes

Without this fix, any component that ships a NetworkPolicy in its OLM bundle manifests would have that resource silently dropped during chart generation — the copy step would log it as "Unsupported resource type" and skip it, even though the downstream template processing step (resource_kinds) already knows how to handle and wrap NetworkPolicy resources.

Reviewers

Definition of Done

  • Code is reviewed.
  • Code is tested.
  • Documentation is updated.
  • All checks and tests pass.
  • Approved by at least one reviewer.
  • Merged into the main/master branch.

Summary by CodeRabbit

  • New Features
    • Added support for Kubernetes NetworkPolicy resources as optional bundle artifacts.

NetworkPolicy was present in resource_kinds (for template processing)
but missing from optional_supported_bundle_resourceTypes (for copying
from bundle/manifests/). This caused NetworkPolicy resources in OLM
bundles to be rejected as unsupported during the copy step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dislbenn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: stolostron/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 08954666-1290-40d8-a57e-fdd26a5871b0

📥 Commits

Reviewing files that changed from the base of the PR and between 1970848 and c0f327e.

📒 Files selected for processing (1)
  • scripts/bundle-generation/bundles-to-charts.py

Walkthrough

The optional bundle resource allowlist now includes the Kubernetes NetworkPolicy kind, with the list reformatted across multiple lines.

Changes

Bundle resource support

Layer / File(s) Summary
Optional resource allowlist
scripts/bundle-generation/bundles-to-charts.py
copy_additional_resources() recognizes NetworkPolicy as an optional supported bundle resource, with the list reformatted for readability.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 10
✅ Passed checks (10 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding NetworkPolicy to the supported bundle resource types.
Description check ✅ Passed The description follows the template well and includes the purpose, related issue, changes made, notes, checklist, and other required sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Only bundles-to-charts.py changed; no test files or Ginkgo titles were added or modified.
Test Structure And Quality ✅ Passed PR only changes a Python allowlist; no Go test code or async/cleanup/assertion patterns are affected.
No-Weak-Crypto ✅ Passed Diff only adds NetworkPolicy to an allowlist; no MD5/SHA1/DES/RC4/ECB or custom crypto logic appears in the touched hunk.
Container-Privileges ✅ Passed Diff only updates bundles-to-charts.py to add NetworkPolicy to an allowlist; no privileged container/K8s settings were introduced.
No-Sensitive-Data-In-Logs ✅ Passed The change only adds NetworkPolicy to an allowlist; it adds no new logging or data-dumping code that could expose sensitive information.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-networkpolicy-to-bundle-resource-types

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dislbenn dislbenn added the lgtm label Jul 28, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit b49e886 into main Jul 28, 2026
6 checks passed
@openshift-merge-bot
openshift-merge-bot Bot deleted the fix/add-networkpolicy-to-bundle-resource-types branch July 28, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant