8000 [fluxcd] update to flux-operator 0.19.0 by kingdonb · Pull Request #880 · cozystack/cozystack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[fluxcd] update to flux-operator 0.19.0 #880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025

Conversation

kingdonb
Copy link
Member
@kingdonb kingdonb commented Apr 24, 2025

Summary by CodeRabbit

  • New Features

    • Introduced configurable API priority and fairness settings for the Flux Operator, allowing prioritization of API requests and inclusion of extra service accounts.
    • Added support for a new skip field in the ResourceSetInputProvider CRD to control update skipping based on label conditions.
  • Bug Fixes

    • Updated service account reference in admin ClusterRoleBinding to use the dedicated service account name for improved accuracy.
  • Documentation

    • Updated Helm chart and app version numbers to 0.19.0 in documentation and metadata.
    • Added documentation for the new apiPriority configuration option in the Flux Operator Helm chart.

Signed-off-by: Kingdon B <kingdon@urmanac.com>
Copy link
Contributor
coderabbitai bot commented Apr 24, 2025

Walkthrough

This update introduces a new apiPriority configuration to the Flux Operator Helm chart, enabling optional Kubernetes API priority and fairness controls for the operator and specified service accounts. The change adds a FlowSchema manifest template, updates the CRD for ResourceSetInputProvider with a new skip.labels field, and revises the Helm values and schema accordingly. Additionally, chart and app versions are incremented from 0.18.0 to 0.19.0 in both the operator and instance charts, with corresponding updates in documentation and metadata.

Changes

File(s) Change Summary
.../fluxcd-operator/charts/flux-operator/Chart.yaml
.../fluxcd/charts/flux-instance/Chart.yaml
Updated chart and app version fields from 0.18.0 to 0.19.0.
.../fluxcd-operator/charts/flux-operator/README.md
.../fluxcd/charts/flux-instance/README.md
Updated version badges from 0.18.0 to 0.19.0. For the operator, also documented the new apiPriority configuration in the values table.
.../fluxcd-operator/charts/flux-operator/values.yaml
.../values.schema.json
Added new apiPriority configuration section, with fields for enabled, level, and extraServiceAccounts, including defaults and schema validation.
.../fluxcd-operator/charts/flux-operator/templates/flowschema.yaml Introduced a new conditional FlowSchema manifest template for API priority and fairness, referencing the new apiPriority values.
.../fluxcd-operator/charts/flux-operator/templates/crds.yaml Extended the ResourceSetInputProvider CRD schema with a new optional skip object containing a labels array for advanced update skipping logic.
.../fluxcd-operator/charts/flux-operator/templates/admin-clusterrole.yaml Changed the service account reference in the ClusterRoleBinding from fullname to serviceAccountName Helm template helper.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HelmChart
    participant KubernetesAPI
    participant ServiceAccount
    participant FlowSchema

    User->>HelmChart: Deploy/upgrade flux-operator with apiPriority.enabled=true
    HelmChart->>KubernetesAPI: Apply CRDs, ClusterRoleBindings, and other manifests
    HelmChart->>KubernetesAPI: Apply FlowSchema (if apiPriority.enabled)
    KubernetesAPI->>FlowSchema: Registers API priority rules
    ServiceAccount->>KubernetesAPI: Makes API requests
    KubernetesAPI->>FlowSchema: Matches requests to FlowSchema rules
    FlowSchema->>KubernetesAPI: Applies priority/fairness as configured
Loading

Suggested reviewers

  • lllamnyp
  • klinch0

Poem

A hop, a skip, a version bump,
New priorities for API’s thump!
FlowSchemas guide the operator’s way,
With fairness rules to save the day.
Labels help us skip and choose,
0.19.0—no time to snooze!
🐇✨


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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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.

Copy link
Member
@kvaps kvaps left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @kingdonb

@kvaps kvaps enabled auto-merge April 24, 2025 12:30
Copy link
Contributor
@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

🧹 Nitpick comments (1)
packages/system/fluxcd-operator/charts/flux-operator/templates/flowschema.yaml (1)

1-41: Preserve indentation in the extraServiceAccounts loop
Using {{- range .Values.apiPriority.extraServiceAccounts }} strips leading whitespace, which can break YAML indentation for the generated - kind: ServiceAccount entries. To maintain correct indent levels, switch to:

{{ range .Values.apiPriority.extraServiceAccounts }}
  - kind: ServiceAccount
    serviceAccount:
      name: {{ .name }}
      namespace: {{ .namespace }}
{{ end }}

Also, run helm lint or helm template on this chart to validate that the rendered FlowSchema YAML is syntactically correct.

🧰 Tools
🪛 YAMLlint (1.35.1)

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

(syntax)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cefcd24 and 44565dc.

📒 Files selected for processing (9)
  • 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/templates/admin-clusterrole.yaml (1 hunks)
  • packages/system/fluxcd-operator/charts/flux-operator/templates/crds.yaml (1 hunks)
  • packages/system/fluxcd-operator/charts/flux-operator/templates/flowschema.yaml (1 hunks)
  • packages/system/fluxcd-operator/charts/flux-operator/values.schema.json (1 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 (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
packages/system/fluxcd-operator/charts/flux-operator/templates/flowschema.yaml

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

(syntax)

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

11-11: Bump chart version and appVersion to 0.19.0
The appVersion and version fields have been correctly updated to v0.19.0 to align with the operator release.

Also applies to: 28-28

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

3-3: Update version badges to 0.19.0
The README badges now reflect the new chart and app version.

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

11-11: Bump flux-instance chart version and appVersion to 0.19.0
The Flux instance chart metadata has been updated consistently with the operator chart.

Also applies to: 28-28

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

3-3: Update version badges in README
Badges now reflect the chart and app version bump to 0.19.0.


36-36: Document new apiPriority configuration
The new apiPriority key is clearly described with default settings and a link to Kubernetes API priority and fairness docs.

packages/system/fluxcd-operator/charts/flux-operator/templates/admin-clusterrole.yaml (1)

21-21: Bind ClusterRoleBinding to the configured service account
Switching from fullname to serviceAccountName ensures the ClusterRoleBinding targets the actual service account (including any custom name).

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

881-892: New skip.labels field is correctly added to the CRD schema
The skip object with its labels array accurately captures the intended skip logic for input providers. Ensure that the controller implementation properly interprets prefixes (!) and that users can omit skip entirely when no skipping behavior is desired.

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

36-44: Verify chart version bump and documentation updates
You’ve added the apiPriority block, but please confirm that:

  1. Chart.yaml has been updated to version 0.19.0 per the PR objective.
  2. The chart’s README (or values documentation) includes examples demonstrating how to use extraServiceAccounts.

Comment on lines +66 to +84
"apiPriority": {
"default": {
"enabled": false,
"extraServiceAccounts": [],
"level": "workload-high"
},
"properties": {
"enabled": {
"type": "boolean"
},
"extraServiceAccounts": {
"type": "array"
},
"level": {
"type": "string"
}
},
"type": "object"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve schema validation for extraServiceAccounts
The current schema defines extraServiceAccounts as a generic array without item constraints, which weakens validation. To ensure each entry has the expected shape, add an items block specifying an object with required name and namespace string fields. For example:

 "extraServiceAccounts": {
   "type": "array",
+  "items": {
+    "type": "object",
+    "properties": {
+      "name": {
+        "type": "string"
+      },
+      "namespace": {
+        "type": "string"
+      }
+    },
+    "required": ["name", "namespace"]
+  }
 }
📝 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
"apiPriority": {
"default": {
"enabled": false,
"extraServiceAccounts": [],
"level": "workload-high"
},
"properties": {
"enabled": {
"type": "boolean"
},
"extraServiceAccounts": {
"type": "array"
},
"level": {
"type": "string"
}
},
"type": "object"
},
"apiPriority": {
"default": {
"enabled": false,
"extraServiceAccounts": [],
"level": "workload-high"
},
"properties": {
"enabled": {
"type": "boolean"
},
"extraServiceAccounts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"namespace": {
"type": "string"
}
},
"required": ["name", "namespace"]
}
},
"level": {
"type": "string"
}
},
"type": "object"
},

@kvaps kvaps disabled auto-merge April 24, 2025 12:43
@kvaps kvaps merged commit 7be5db8 into cozystack:main Apr 24, 2025
5 of 7 checks passed
@kvaps
Copy link
Member
kvaps commented Apr 24, 2025

Allright, we need to fix our pipeline to be able run tests for external forks

@kingdonb kingdonb deleted the update-flux-operator branch April 28, 2025 12:47
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.

2 participants
0