Skip to content

feat(bundle): populate CSV alm-examples from config/samples#221

Draft
aslakknutsen wants to merge 1 commit intonetworking-incubator:mainfrom
aslakknutsen:olm_examples
Draft

feat(bundle): populate CSV alm-examples from config/samples#221
aslakknutsen wants to merge 1 commit intonetworking-incubator:mainfrom
aslakknutsen:olm_examples

Conversation

@aslakknutsen
Copy link
Copy Markdown
Contributor

Generate metadata.annotations.alm-examples when building the OLM bundle so OpenShift/OLM console samples match the Engine and RuleSet manifests under config/samples. Only waf.k8s.coraza.io documents are included; RuleSet is ordered before Engine. JSON is indented and written as a YAML literal block for readable diffs. Add --samples-dir to override the sample path.

Fixes: #220
Made-with: Cursor

Describe the pull request

A clear and concise description of what is being introduced

Which issue this resolves

Resolves #_ (if applicable)

Additional context

Add any other context.

Generate metadata.annotations.alm-examples when building the OLM bundle so
OpenShift/OLM console samples match the Engine and RuleSet manifests under
config/samples. Only waf.k8s.coraza.io documents are included; RuleSet is
ordered before Engine. JSON is indented and written as a YAML literal block
for readable diffs. Add --samples-dir to override the sample path.

Fixes: networking-incubator#220
Made-with: Cursor
Signed-off-by: Aslak Knutsen <aslak@4fs.no>
Copilot AI review requested due to automatic review settings March 27, 2026 15:51
@shaneutt shaneutt added area/infrastructure CI, packaging, etc size/M labels Mar 27, 2026
@shaneutt shaneutt added this to the v0.4.0 milestone Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the OLM bundle generator to derive the CSV metadata.annotations.alm-examples from the repository’s shipped sample CRs, keeping the OpenShift/OLM console examples aligned with config/samples.

Changes:

  • Load multi-document YAML from config/samples/*.yaml, filtering to owned API group (waf.k8s.coraza.io/*) and sorting RuleSet before Engine.
  • Serialize examples as indented JSON and emit it as a YAML literal block (|) for readable diffs.
  • Add --samples-dir flag to override the samples directory used for alm-examples.

@aslakknutsen aslakknutsen self-assigned this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

Populate CSV alm-examples from config/samples in generate_bundle.py

3 participants