(air gapped): disable fluxcd artifact by default - #964
Conversation
WalkthroughA new configuration key named Changes
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Signed-off-by: kklinch0 <kklinch0@gmail.com>
b063795 to
b753fd9
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/system/fluxcd/values.yaml (1)
6-9: Document and validate the newartifactoption.Since this is a new configuration field, update the chart’s documentation (e.g.,
README.md) orvalues.schema.jsonto:
- Explain what values are supported (empty string vs. URL/registry)
- Describe how an empty string disables artifact publishing
- Detail default behavior when the field is omitted
This will help users discover and correctly use the new option.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
packages/system/fluxcd/values.yaml(1 hunks)
🔇 Additional comments (1)
packages/system/fluxcd/values.yaml (1)
7-7:Details
✅ Verification successful
Verify that the
artifactkey is actually consumed by the chart.You’ve introduced
artifact: ""to disable artifact publishing by default, but we need to confirm the Helm templates reference and respect this new setting. Please search thetemplates/directory for the exact path (e.g..Values.flux-instance.instance.cluster.distribution.artifact) and ensure an empty string correctly disables artifact configuration.
🏁 Script executed:
#!/bin/bash # Check for references to the new artifact key in chart templates rg --heading '\.Values\.flux-instance\.instance\.cluster\.distribution\.artifact' -g 'templates/**/*.yaml'Length of output: 257
🏁 Script executed:
#!/bin/bash # Retry searching for any “artifact” references in the Flux CD chart templates without restrictive globs rg -n '\.Values\..*artifact' packages/system/fluxcd/templatesLength of output: 136
🏁 Script executed:
#!/bin/bash set -e echo "Finding Chart.yaml in packages/system/fluxcd..." find packages/system/fluxcd -iname 'Chart.yaml' || echo "No Chart.yaml found under packages/system/fluxcd" echo echo "Locating ‘templates’ directories under packages/system/fluxcd..." find packages/system/fluxcd -type d -name 'templates' || echo "No templates directory under packages/system/fluxcd" echo echo "Searching for ‘artifact’ references in any discovered templates directories..." for dir in $(find packages/system/fluxcd -type d -name 'templates'); do echo "--> Checking $dir" rg -n '\.Values\..*artifact' "$dir" || echo " No artifact references in $dir" doneLength of output: 1447
artifact key is consumed by the flux-instance subchart
- The
artifactsetting frompackages/system/fluxcd/values.yamlfeeds directly into the subchart’sinstance.yamltemplate:
‑ packages/system/fluxcd/charts/flux-instance/templates/instance.yaml:19artifact: {{ .Values.instance.distribution.artifact }}- An empty string (
"") will renderartifact: ""in the generated manifest.No changes to the templates are required—this confirms the key is referenced.
Default `artifact` field for FluxCD operator to empty string, so it uses embedded manifests and is compatible with air-gapped environments. (cherry picked from commit 775ecb7) Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
The flux-instance template rendered spec.distribution.artifact unconditionally, unlike the sibling optional fields (artifactPullSecret, imagePullSecret, variant). The umbrella default is empty to use the operator's embedded manifests (the air-gapped default from cozystack#964), but an empty value renders as YAML null, and the flux-operator v0.50.0 CRD types the field as a non-nullable string, so the API rejects the FluxInstance. Guest Kubernetes clusters with the fluxcd addon enabled could therefore never install it: the sub-release looped install/uninstall, the parent kubernetes release stayed InProgress, and the cluster never reached Ready. Guard the field so an empty value is omitted (the operator falls back to its embedded manifests, preserving the air-gapped default) while a non-empty artifact still renders. The template lives in the vendored subchart, so the change is carried as a patch applied by 'make update'. Signed-off-by: Ivan Okhotnikov <xorokhotnikov@gmail.com>
The flux-instance template rendered spec.distribution.artifact unconditionally, unlike the sibling optional fields (artifactPullSecret, imagePullSecret, variant). The umbrella default is empty to use the operator's embedded manifests (the air-gapped default from cozystack#964), but an empty value renders as YAML null, and the flux-operator v0.50.0 CRD types the field as a non-nullable string, so the API rejects the FluxInstance. Guest Kubernetes clusters with the fluxcd addon enabled could therefore never install it: the sub-release looped install/uninstall, the parent kubernetes release stayed InProgress, and the cluster never reached Ready. Guard the field so an empty value is omitted (the operator falls back to its embedded manifests, preserving the air-gapped default) while a non-empty artifact still renders. The template lives in the vendored subchart, so the change is carried as a patch applied by 'make update'. Signed-off-by: Ivan Okhotnikov <xorokhotnikov@gmail.com>
The flux-instance template rendered spec.distribution.artifact unconditionally, unlike the sibling optional fields (artifactPullSecret, imagePullSecret, variant). The umbrella default is empty to use the operator's embedded manifests (the air-gapped default from cozystack#964), but an empty value renders as YAML null. In the flux-operator v0.50.0 CRD the field is optional yet typed 'string' with pattern ^oci://.*$ and is not nullable, so the rendered null (like an empty string) fails schema validation and the API rejects the FluxInstance. Guest Kubernetes clusters with the fluxcd addon enabled could therefore never install it: the sub-release looped install/uninstall, the parent kubernetes release stayed InProgress, and the cluster never reached Ready. Guard the field so an empty value is omitted (the operator falls back to its embedded manifests, preserving the air-gapped default) while a non-empty artifact still renders. The template lives in the vendored subchart, so the change is carried as a patch applied by 'make update'. Signed-off-by: Ivan Okhotnikov <xorokhotnikov@gmail.com>
The flux-instance template rendered spec.distribution.artifact unconditionally, unlike the sibling optional fields (artifactPullSecret, imagePullSecret, variant). The umbrella default is empty to use the operator's embedded manifests (the air-gapped default from cozystack#964), but an empty value renders as YAML null. In the flux-operator v0.50.0 CRD the field is optional yet typed 'string' with pattern ^oci://.*$ and is not nullable, so the rendered null (like an empty string) fails schema validation and the API rejects the FluxInstance. Guest Kubernetes clusters with the fluxcd addon enabled could therefore never install it: the sub-release looped install/uninstall, the parent kubernetes release stayed InProgress, and the cluster never reached Ready. Guard the field so an empty value is omitted (the operator falls back to its embedded manifests, preserving the air-gapped default) while a non-empty artifact still renders. The template lives in the vendored subchart, so the change is carried as a patch applied by 'make update'. Signed-off-by: Ivan Okhotnikov <xorokhotnikov@gmail.com>
…st clusters (#3284) ## What this PR does Guest Kubernetes clusters (`apps/kubernetes`) with the `fluxcd` addon enabled never became `Ready`. The `flux-instance` template renders `spec.distribution.artifact` unconditionally, unlike the sibling optional fields (`artifactPullSecret`, `imagePullSecret`, `variant`, which are all `{{- if }}`-guarded). The umbrella default is empty (`artifact: ""`) so the operator uses its embedded manifests, which is the intended air-gapped default (#964, and the upstream recommendation). But an empty value renders as YAML `null`, and the flux-operator v0.50.0 CRD types `distribution.artifact` as a non-nullable `string` (pattern `^oci://.*$`), so the API rejects the `FluxInstance`. Result: the addon's HelmRelease looped install/uninstall (`remediation.retries: -1`), the parent `kubernetes` release stayed `InProgress`, and the cluster CR was stuck `Ready=Unknown`. This guards the field so an empty value is omitted entirely. Behaviour: - empty (default) -> field omitted -> operator falls back to embedded manifests: **air-gapped default preserved**, and the CRD accepts it (artifact is not in `distribution.required`); - non-empty -> renders as before; `valuesOverride` still applies. The template is a vendored subchart (`make update` runs `helm pull`), so the change is carried as `patches/guard-distribution-artifact.diff` and applied by the `update` target, matching the convention of the sibling `fluxcd-operator` package (`patch -p1 < patches/*.diff`). Verified with `helm template packages/system/fluxcd`: - default values -> no `artifact:` line (before this PR: `artifact: null`); - `--set flux-instance.instance.distribution.artifact=oci://example.com/x:1` -> renders. The affected path is off by default (`addons.fluxcd.enabled: false`) and not exercised by the in-repo CI values, which is why default e2e stayed green. Closes #3283 ### Release note ```release-note fix(fluxcd): guest Kubernetes clusters with the fluxcd addon enabled no longer fail to install; an empty distribution artifact is now omitted so the operator uses its embedded manifests (air-gapped default preserved) instead of rendering an invalid null ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Prevented Flux instance configuration from including an empty distribution artifact value, which could cause validation failures. * Improved the generated FluxInstance manifest so the artifact field is omitted entirely when no distribution artifact is provided. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit