Skip to content

(air gapped): disable fluxcd artifact by default - #964

Merged
Timofei Larkin (lllamnyp) merged 1 commit into
mainfrom
(air-gapped)--disable-fluxcd-artifact-by-default
May 20, 2025
Merged

(air gapped): disable fluxcd artifact by default#964
Timofei Larkin (lllamnyp) merged 1 commit into
mainfrom
(air-gapped)--disable-fluxcd-artifact-by-default

Conversation

@klinch0

@klinch0 klinch0 commented May 20, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • Added a new configuration option for artifact specification in the distribution settings.

@coderabbitai

coderabbitai Bot commented May 20, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

A new configuration key named artifact with an empty string value was added under the distribution section in the flux-instance.instance.cluster hierarchy of the values.yaml file. No other files or logic were modified.

Changes

File(s) Change Summary
packages/system/fluxcd/values.yaml Added artifact key (empty string) under distribution section.

Poem

A new key called artifact, so neat,
In values it found its seat.
Nested under distribution’s care,
Awaiting a value to soon declare.
Fluxcd’s yaml grows by one,
Configuration hopping, fun!
🐇✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit 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.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit 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 Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Signed-off-by: kklinch0 <kklinch0@gmail.com>
@klinch0
klinch0 force-pushed the (air-gapped)--disable-fluxcd-artifact-by-default branch from b063795 to b753fd9 Compare May 20, 2025 10:10

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/system/fluxcd/values.yaml (1)

6-9: Document and validate the new artifact option.

Since this is a new configuration field, update the chart’s documentation (e.g., README.md) or values.schema.json to:

  • 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

📥 Commits

Reviewing files that changed from the base of the PR and between 31b110c and b753fd9.

📒 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 artifact key 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 the templates/ 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/templates

Length 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"
done

Length of output: 1447


artifact key is consumed by the flux-instance subchart

  • The artifact setting from packages/system/fluxcd/values.yaml feeds directly into the subchart’s instance.yaml template:
    ‑ packages/system/fluxcd/charts/flux-instance/templates/instance.yaml:19
      artifact: {{ .Values.instance.distribution.artifact }}
  • An empty string ("") will render artifact: "" in the generated manifest.

No changes to the templates are required—this confirms the key is referenced.

@lllamnyp Timofei Larkin (lllamnyp) added the ok-to-test Indicates a non-member PR is safe to run CI on label May 20, 2025
@lllamnyp
Timofei Larkin (lllamnyp) deleted the (air-gapped)--disable-fluxcd-artifact-by-default branch May 20, 2025 12:46
Timofei Larkin (lllamnyp) added a commit that referenced this pull request May 20, 2025
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>
IvanHunters added a commit to IvanHunters/cozystack that referenced this pull request Jul 14, 2026
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>
IvanHunters added a commit to IvanHunters/cozystack that referenced this pull request Jul 14, 2026
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>
IvanHunters added a commit to IvanHunters/cozystack that referenced this pull request Jul 14, 2026
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>
IvanHunters added a commit to IvanHunters/cozystack that referenced this pull request Jul 14, 2026
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>
Aleksei Sviridkin (lexfrei) added a commit that referenced this pull request Jul 14, 2026
…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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Indicates a non-member PR is safe to run CI on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants