Skip to content

feat: add flux ocm component#66

Merged
olzemal merged 1 commit into
mainfrom
feat/add-flux
May 22, 2026
Merged

feat: add flux ocm component#66
olzemal merged 1 commit into
mainfrom
feat/add-flux

Conversation

@olzemal
Copy link
Copy Markdown
Contributor

@olzemal olzemal commented May 20, 2026

What

Add OCM component for flux.

Why

To add a missing SOLAR prerequisite and enable teams to use gitops.

Testing

# setup cluster with zot registry
kind create cluster
helm repo add project-zot http://zotregistry.dev/helm-charts && helm repo update
helm install zot project-zot/zot -n zot --create-namespace

# create ctf
cd flux/
ocm add componentversion --version 0.1.0 --create --file ./ctf component-constructor.yaml

# upload ctf
NODEPORT=$(kubectl get svc -n zot zot -ojsonpath='{.spec.ports[0].nodePort}')
kubectl port-forward -n zot svc/zot $NODEPORT:5000 &
ocm transfer ctf --copy-resources ./ctf http://localhost:$NODEPORT/odc

# validate values template
ocm-kit http://localhost:$NODEPORT/odc//opendefense.cloud/flux:0.1.0 > flux-values.yaml

# install flux
helm upgrade --install -n flux-system --create-namespace flux oci://localhost:$NODEPORT/odc/fluxcd-community/charts/flux2:2.18.3 --values flux-values.yaml

# validate images get pulled from local zot
kubectl get pod -n flux-system -oyaml | yq '.items[].spec.containers[].image'

Checklist

  • Tests added/updated
  • No breaking changes (or upgrade path documented above)
  • Readable commit history (squashed and cleaned up as desired)
  • AI code review considered and comments resolved

Summary by CodeRabbit

  • New Features

    • Flux is now packaged as an Open Component Model component with pinned versions for controller images, Helm charts, and configuration templates, enabling structured distribution to registries with automatic image reference management.
  • Documentation

    • Added comprehensive guide covering component structure, packaging procedures, step-by-step setup instructions, resource definitions, and runtime image reference handling for OCM-based Flux deployment.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

📝 Walkthrough

Walkthrough

This PR introduces a new OCM component package for Flux. It defines the component structure with pinned chart and image versions, provides a Helm values template that references those pinned resources, and documents the quick-start workflow for building, transferring, and deploying the component.

Changes

Flux OCM Component

Layer / File(s) Summary
Component resource definition
flux/component-constructor.yaml
Defines the opendefense.cloud/flux OCM component with Kubernetes-style labels and a resources list pinning the Flux Helm chart, values template input, installation YAML, and eight Flux controller images (helm-controller, flux-cli, image-automation-controller, image-reflector-controller, kustomize-controller, notification-controller, source-controller, source-watcher) from OCI artifacts or external sources.
Values template and documentation
flux/values.yaml.tpl, flux/README.md
Helm template that renders image references for each Flux controller by extracting Host, Repository, and Tag from .OCIResources and formatting them into YAML image and tag fields; README documents the component file layout, step-by-step quick-start for creating a CTF archive and transferring to a registry, and explains image reference rewriting behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A Flux component hops in, bundled with care,
With charts and controllers pinned fair,
The template unfurls each image's address,
While docs guide the user through OCM's finesse!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description check ✅ Passed The PR description covers all required template sections: What, Why, Testing with detailed bash commands, and a completed Checklist with 3 of 4 items marked.
Title check ✅ Passed The title 'feat: add flux ocm component' directly and clearly describes the main change—adding a Flux OCM component. It is concise, specific, and accurately reflects the primary objective of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/add-flux

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 and usage tips.

@olzemal olzemal marked this pull request as ready for review May 21, 2026 06:21
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@flux/README.md`:
- Around line 7-11: The fenced code block showing the directory tree (the block
that begins with ``` and contains "flux/ ├── component-constructor.yaml ...")
needs a language identifier to satisfy markdown linting; update that opening
fence to include a language token such as "text" (i.e., change ``` to ```text)
so the code block is fenced with a language and the README.md markdown linter
will pass.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f496f713-8346-436d-8ce6-a52a86621ccb

📥 Commits

Reviewing files that changed from the base of the PR and between b6a7363 and e698435.

📒 Files selected for processing (3)
  • flux/README.md
  • flux/component-constructor.yaml
  • flux/values.yaml.tpl

Comment thread flux/README.md Outdated
@olzemal olzemal changed the title feat: add initial flux ocm component feat: add flux ocm component May 21, 2026
@olzemal olzemal merged commit bd23ffb into main May 22, 2026
1 check passed
@olzemal olzemal deleted the feat/add-flux branch May 22, 2026 08:54
@coderabbitai coderabbitai Bot mentioned this pull request May 22, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants