Skip to content

Update Flux Operator (v0.26.0) - #1302

Closed
Kingdon Barrett (kingdonb) wants to merge 2 commits into
cozystack:mainfrom
kingdonb:update-flux-operator
Closed

Kingdon Barrett (kingdonb) wants to merge 2 commits into
cozystack:mainfrom
kingdonb:update-flux-operator

Conversation

@kingdonb

@kingdonb Kingdon Barrett (kingdonb) commented Aug 4, 2025 •

Copy link
Copy Markdown
Member

Changelog:
https://github.com/controlplaneio-fluxcd/flux-operator/releases/tag/v0.26.0
(and https://github.com/controlplaneio-fluxcd/flux-operator/releases/tag/v0.25.0)

Summary by CodeRabbit

  • New Features

    • Introduced a configurable healthcheck job for post-install and post-upgrade validation in the Flux Instance Helm chart, including options for timeout, image, resources, security, and scheduling.
    • Added support for creating a dedicated ServiceAccount for the healthcheck job.
  • Improvements

    • Enhanced configuration schemas for both Flux Operator and Flux Instance charts, providing explicit typing, required fields, and improved validation.
    • Increased default CPU resource limit for the Flux Operator chart from 1 CPU to 2 CPUs.
  • Documentation

    • Updated documentation and version badges to reflect the new 0.26.0 release.
    • Documented new healthcheck configuration options in the Flux Instance chart README.

@gemini-code-assist gemini-code-assist 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.

Summary of Changes

Hello Kingdon Barrett (@kingdonb), I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on upgrading the Flux Operator and its associated Flux Instance Helm charts to version v0.26.0. Key changes include updating chart metadata, adjusting default resource allocations for the operator, enhancing schema validation for chart values, and introducing a new healthcheck mechanism for Flux instances to ensure successful deployments.

Highlights

  • Flux Operator Chart Update: The flux-operator Helm chart has been updated to version v0.26.0, including a bump in the appVersion and version fields in Chart.yaml and README.md.
  • Flux Operator Resource Limits Adjustment: The default CPU resource limit for the Flux Operator has been increased from 1000m to 2000m in values.yaml.
  • Flux Operator Helm Chart Schema Enhancements: The values.schema.json for the flux-operator chart has been significantly updated to include more explicit type definitions (type: object, type: array) and required fields for various parameters, improving schema validation.
  • Flux Instance Chart Update: The flux-instance Helm chart has also been updated to version v0.26.0, with corresponding version bumps in Chart.yaml and README.md.
  • New Healthcheck Feature for Flux Instance: A new healthcheck feature has been introduced for the flux-instance chart. This includes new Helm templates (healthcheck.yaml, serviceaccount.yaml) to deploy a Job that performs post-install and post-upgrade health checks, along with comprehensive configuration options in values.yaml and values.schema.json.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the Flux Operator and related charts to version v0.26.0. The changes include version bumps, updated resource limits, and schema improvements. A new healthcheck feature is introduced for the flux-instance chart.

My review focuses on the new healthcheck implementation. I've identified a critical issue where the healthcheck will fail due to missing RBAC permissions if a new service account is created. I've also found a high-severity issue with the default service account naming which could cause conflicts, and a medium-severity issue with inconsistent labels in the healthcheck job template.

I have provided detailed suggestions to address these points to ensure the new feature is robust and secure.

Comment on lines +1 to +17
{{- if .Values.healthcheck.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.healthcheck.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "flux-instance.labels" . | nindent 4 }}
{{- with .Values.commonLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.commonAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.healthcheck.serviceAccount.automount }}
{{- end }}

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.

critical

When healthcheck.serviceAccount.create is true, a new ServiceAccount is created for the healthcheck Job. However, this ServiceAccount lacks the necessary RBAC permissions to check the status of the FluxInstance resource, which will cause the healthcheck Job to fail with permission errors.

You should also create a Role and RoleBinding to grant the required permissions. These resources should also be conditional on healthcheck.serviceAccount.create.

Here are the suggested resources to add (e.g., in a new rbac.yaml template or appended to this file):

{{- if .Values.healthcheck.serviceAccount.create }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: {{ .Values.healthcheck.serviceAccount.name | default (printf "%s-healthcheck" (include "flux-instance.fullname" .)) }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "flux-instance.labels" . | nindent 4 }}
rules:
  - apiGroups: ["fluxcd.controlplane.io"]
    resources: ["fluxinstances"]
    verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ .Values.healthcheck.serviceAccount.name | default (printf "%s-healthcheck" (include "flux-instance.fullname" .)) }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "flux-instance.labels" . | nindent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ .Values.healthcheck.serviceAccount.name | default (printf "%s-healthcheck" (include "flux-instance.fullname" .)) }}
subjects:
  - kind: ServiceAccount
    name: {{ .Values.healthcheck.serviceAccount.name | default (printf "%s-healthcheck" (include "flux-instance.fullname" .)) }}
    namespace: {{ .Release.Namespace }}
{{- end }}

imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ .Values.healthcheck.serviceAccount.name }}

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.

high

To ensure the job uses the correct service account (especially when one is created dynamically), a default, release-specific name should be used if no name is provided.

      serviceAccountName: {{ .Values.healthcheck.serviceAccount.name | default (printf "%s-healthcheck" (include "flux-instance.fullname" .)) }}

apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.healthcheck.serviceAccount.name }}

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.

high

To avoid conflicts, a default, release-specific name should be used for the service account if no name is provided.

  name: {{ .Values.healthcheck.serviceAccount.name | default (printf "%s-healthcheck" (include "flux-instance.fullname" .)) }}

"default": {
"automount": true,
"create": false,
"name": "flux-operator"

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.

high

To be consistent with the change in values.yaml, the default name in the schema should also be an empty string.

                        "name": ""

Comment on lines +88 to +91
serviceAccount: # @schema default: {"create":false,"automount":true,"name":"flux-operator"}
create: false
automount: true
name: "flux-operator"

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.

high

The default service account name flux-operator is problematic when create is set to true, as it can conflict with the service account used by the Flux Operator itself. This could lead to deployment failures or unintended permissions.

It's better to use a release-specific name for the created service account. I recommend changing the default name to an empty string and using a default in the templates.

  serviceAccount: # @schema default: {"create":false,"automount":true,"name":""}
    create: false
    automount: true
    name: ""

Comment on lines +19 to +22
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"

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.

medium

The pod template labels are missing the app.kubernetes.io/version label, which is present on the Job metadata. For consistency and to follow Kubernetes recommended labels, it's good to include it here as well.

      labels:
        app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
        app.kubernetes.io/instance: {{ .Release.Name | quote }}
        app.kubernetes.io/version: {{ .Chart.AppVersion }}
        helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"

@coderabbitai

coderabbitai Bot commented Aug 4, 2025 •

Copy link
Copy Markdown
Contributor

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

This update advances both the flux-operator and flux-instance Helm charts to version 0.26.0. It introduces a configurable healthcheck job to the flux-instance chart, expands and clarifies JSON schemas, increases the default CPU limit for the operator, and updates documentation and example values accordingly.

Changes

Cohort / File(s) Change Summary
Flux Operator Helm Chart Version & Resources
packages/system/fluxcd-operator/charts/flux-operator/Chart.yaml, .../README.md, .../values.yaml
Updated chart and app version from 0.24.1 to 0.26.0. Increased default CPU resource limit from 1000m to 2000m in both values and documentation. No other changes to chart metadata or resource requests.
Flux Operator Schema
packages/system/fluxcd-operator/charts/flux-operator/values.schema.json
Enhanced JSON schema with explicit types for objects/arrays, added required fields for resources and securityContext, improved validation precision, and clarified structure. No changes to default values or logic.
Flux Instance Helm Chart Version & Docs
packages/system/fluxcd/charts/flux-instance/Chart.yaml, .../README.md
Updated chart and app version from 0.24.1 to 0.26.0. README badges updated. Added documentation for new healthcheck.enabled and healthcheck.timeout configuration options.
Flux Instance Healthcheck Feature
packages/system/fluxcd/charts/flux-instance/templates/healthcheck.yaml, .../templates/serviceaccount.yaml, .../values.yaml
Introduced a new healthcheck Job manifest template, conditionally created when enabled. Added a ServiceAccount template for the healthcheck job. Extended values.yaml with a new healthcheck section for image, resources, security, affinity, and other pod/job options.
Flux Instance Schema Enhancements
packages/system/fluxcd/charts/flux-instance/values.schema.json
Major expansion and refinement of JSON schema: added explicit types, enumerations, required fields, and a new healthcheck object with nested properties and defaults. Improved validation and clarity for all configuration sections.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Helm
    participant Kubernetes
    participant Healthcheck Job

    User->>Helm: Install/Upgrade flux-instance chart (with healthcheck.enabled=true)
    Helm->>Kubernetes: Deploy resources (including Healthcheck Job as a hook)
    Kubernetes->>Healthcheck Job: Create Job (post-install/post-upgrade)
    Healthcheck Job->>Kubernetes: Run healthcheck container
    Healthcheck Job->>Kubernetes: Wait for instance readiness (with timeout)
    Healthcheck Job-->>Kubernetes: Complete and cleanup Job (per hook policy)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

  • Upgrade Flux operator to 0.10 #387: Updates the flux-operator Helm chart version and configuration, similar to this PR's version bump and chart enhancements, but for an earlier version and with different features.

Suggested labels

documentation, enhancement, size:M, lgtm

Suggested reviewers

  • lllamnyp
  • klinch0
  • kvaps

Poem

🐰
A hop to version twenty-six,
With healthchecks now, our pods can fix!
More CPU for the operator’s run,
Schemas explicit—validation’s fun!
Docs and values, all aligned anew,
CozyStack’s charts, reliable and true.
— A happy rabbit, reviewing for you!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
  • 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate unit tests to generate unit tests for 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.

@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: 1

♻️ Duplicate comments (6)
packages/system/fluxcd/charts/flux-instance/templates/serviceaccount.yaml (2)

1-17: ServiceAccount still lacks RBAC and release-specific default name
Same concerns raised previously (missing Role/RoleBinding and fallback to a release-scoped default name) remain unresolved.


5-5: Hard-coded name may collide with existing SA
Reuse the earlier suggestion to default to (<release>-healthcheck) when .Values.healthcheck.serviceAccount.name is empty.

packages/system/fluxcd/charts/flux-instance/templates/healthcheck.yaml (2)

20-22: Pod-template labels still missing app.kubernetes.io/version
Previous feedback on adding the version label has not been applied.


29-30: serviceAccountName should fall back to a release-scoped default
Please apply the recommended default expression to avoid name collisions.

packages/system/fluxcd/charts/flux-instance/values.yaml (1)

88-92: Default SA name still set to flux-operator
Leaving this non-empty invites conflicts with the operator’s own SA. Prior comment suggested defaulting to an empty string and handling the fallback in the template.

packages/system/fluxcd/charts/flux-instance/values.schema.json (1)

219-223: Schema default for serviceAccount.name should be empty
Mirrors the unresolved values.yaml feedback; default should be "" to prevent collisions.

🧹 Nitpick comments (3)
packages/system/fluxcd-operator/charts/flux-operator/values.schema.json (2)

146-151: *image.pullSecrets is typed as “array of object”, but the usual Helm idiom is list of strings

Most users pass pull secrets like:

image:
  pullSecrets:
    - regcred

Validating against type: object will reject this common pattern and requires:

image:
  pullSecrets:
    - name: regcred

If deliberate, document the deviation clearly in the README. Otherwise, switch the schema to type: string.

-                "pullSecrets": {
-                    "type": "array",
-                    "uniqueItems": true,
-                    "items": {
-                        "type": "object"
-                    }
+                "pullSecrets": {
+                    "type": "array",
+                    "uniqueItems": true,
+                    "items": {
+                        "type": "string"
+                    }
                 },

330-373: Good move enforcing a hardened securityContext – tiny nitpick

Since the object is now required, consider adding "additionalProperties": false to lock the surface area and prevent typos in security-sensitive fields.

packages/system/fluxcd-operator/charts/flux-operator/Chart.yaml (1)

11-12: Chart minor version may not reflect the breaking-change introduced in the schema

If the values.schema.json requirement change stays, consider bumping version: to the next major (or at least note the break in the release notes) to follow Helm semver expectations.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ddbe32 and 1cc39c7.

📒 Files selected for processing (10)
  • packages/system/fluxcd-operator/charts/flux-operator/Chart.yaml (2 hunks)
  • packages/system/fluxcd-operator/charts/flux-operator/README.md (2 hunks)
  • packages/system/fluxcd-operator/charts/flux-operator/values.schema.json (12 hunks)
  • packages/system/fluxcd-operator/charts/flux-operator/values.yaml (1 hunks)
  • packages/system/fluxcd/charts/flux-instance/Chart.yaml (2 hunks)
  • packages/system/fluxcd/charts/flux-instance/README.md (2 hunks)
  • packages/system/fluxcd/charts/flux-instance/templates/healthcheck.yaml (1 hunks)
  • packages/system/fluxcd/charts/flux-instance/templates/serviceaccount.yaml (1 hunks)
  • packages/system/fluxcd/charts/flux-instance/values.schema.json (4 hunks)
  • packages/system/fluxcd/charts/flux-instance/values.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: the `./charts/robotlb/` directory in the hetzner-robotlb package contains vendored code, and the tea...
Learnt from: lllamnyp
PR: cozystack/cozystack#1233
File: packages/system/hetzner-robotlb/charts/robotlb/templates/deployment.yaml:33-35
Timestamp: 2025-07-23T09:15:09.658Z
Learning: The `./charts/robotlb/` directory in the hetzner-robotlb package contains vendored code, and the team generally avoids modifying vendored code to maintain clean separation from upstream dependencies.

Applied to files:

  • packages/system/fluxcd/charts/flux-instance/Chart.yaml
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/system/fluxcd-operator/charts/flux-operator/values.schema.json
📚 Learning: in cosi (container object storage interface), bucketaccessclass resources have fields like drivernam...
Learnt from: lllamnyp
PR: cozystack/cozystack#1239
File: packages/extra/seaweedfs/templates/external/cosi-bucket-class.yaml:3-15
Timestamp: 2025-07-24T13:21:17.388Z
Learning: In COSI (Container Object Storage Interface), BucketAccessClass resources have fields like driverName and authenticationType at the top level, not under a spec block. Only BucketClass resources require a spec block for fields like driverName and deletionPolicy.

Applied to files:

  • packages/system/fluxcd/charts/flux-instance/values.schema.json
🪛 YAMLlint (1.37.1)
packages/system/fluxcd/charts/flux-instance/templates/serviceaccount.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[warning] 10-10: wrong indentation: expected 2 but found 4

(indentation)


[warning] 11-11: wrong indentation: expected 2 but found 4

(indentation)

packages/system/fluxcd/charts/flux-instance/templates/healthcheck.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

🔇 Additional comments (5)
packages/system/fluxcd-operator/charts/flux-operator/values.yaml (1)

48-50: CPU limit doubled to 2000m – verify this is intentional for all default installs

The default overhead jumps from 1 vCPU to 2 vCPU per operator pod. On small clusters (e.g., single-node dev clusters) this may prevent scheduling or trigger cluster-autoscaler scale-ups.

If the increase is only needed for large environments, consider lowering the default and documenting how to raise it instead.

No code change required – just confirm the operational impact.

packages/system/fluxcd-operator/charts/flux-operator/README.md (1)

59-60: Table entry updated – 👍

The README now reflects the new CPU limit; memory figures remain unchanged and consistent with values.yaml.

packages/system/fluxcd-operator/charts/flux-operator/Chart.yaml (1)

28-28: LGTM on metadata bump – version and appVersion are aligned with upstream 0.26.0 tag.

packages/system/fluxcd/charts/flux-instance/Chart.yaml (1)

11-12: Version alignment looks good – flux-instance now tracks the same v0.26.0 release as the operator.

packages/system/fluxcd/charts/flux-instance/README.md (1)

3-4: Docs accurately updated for 0.26.0 — LGTM
Version badges and new health-check options are reflected correctly.

Also applies to: 40-41

Comment on lines +3 to +7
"type": "object",
"required": [
"resources",
"securityContext"
],

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.

💡 Verification agent

🧩 Analysis chain

resources and securityContext added to the global required list – this is a (silent) breaking-change

Requiring these keys means all user-supplied values.yaml files that omit either block will now fail chart validation.
Helm chart ≃ semver best-practice states that any breaking change requires a major version bump (see “Versioning” in Helm docs). The chart was only bumped from 0.24.x → 0.26.x, so consumers may upgrade expecting backwards compatibility and hit an error.

Please either

  1. drop these two entries from the required array, or
  2. bump the chart version to 1.0.0 (or at least 0.27.0 with a release note that it is breaking).
-    "required": [
-        "resources",
-        "securityContext"
-    ],
+    // keep validation strict by providing defaults, but avoid a breaking change
+    "required": [],

🏁 Script executed:

#!/bin/bash
# Inspect the required fields in the values.schema.json
echo "---- values.schema.json (lines 1–20) ----"
sed -n '1,20p' packages/system/fluxcd-operator/charts/flux-operator/values.schema.json

# Inspect the chart version in Chart.yaml
echo
echo "---- Chart.yaml version ----"
grep -E '^version:' -n packages/system/fluxcd-operator/charts/flux-operator/Chart.yaml

Length of output: 1092


Address the breaking change in values.schema.json

Requiring resources and securityContext at the top level now turns into a silent break for any consumer that omits those blocks. The chart’s version is currently 0.26.0 (Chart.yaml: line 28), so you must either:

• Remove those entries from the required array to preserve backward compatibility

--- a/packages/system/fluxcd-operator/charts/flux-operator/values.schema.json
+++ b/packages/system/fluxcd-operator/charts/flux-operator/values.schema.json
@@ -3,7 +3,7 @@
     "$schema": "https://json-schema.org/draft/2019-09/schema",
     "type": "object",
-    "required": [
-        "resources",
-        "securityContext"
-    ],
+    "required": [],
     "properties": {
       "affinity": {
         …

• Or bump the chart version in Chart.yaml to 0.27.0 (or 1.0.0) and clearly document the breaking change in your release notes.

Files to update:

  • packages/system/fluxcd-operator/charts/flux-operator/values.schema.json (lines 3–7)
  • packages/system/fluxcd-operator/charts/flux-operator/Chart.yaml (version: 0.26.0 → 0.27.0/1.0.0)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"type": "object",
"required": [
"resources",
"securityContext"
],
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"required": [],
"properties": {
"affinity": {
…
🤖 Prompt for AI Agents
In packages/system/fluxcd-operator/charts/flux-operator/values.schema.json lines
3 to 7, the "resources" and "securityContext" fields are marked as required,
causing a breaking change for consumers omitting these fields. To fix this,
either remove these fields from the "required" array to maintain backward
compatibility or update the chart version in
packages/system/fluxcd-operator/charts/flux-operator/Chart.yaml from 0.26.0 to
0.27.0 or 1.0.0 and document the breaking change in the release notes
accordingly.

@kingdonb
Kingdon Barrett (kingdonb) deleted the update-flux-operator branch August 6, 2025 17:24
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.

1 participant