8000 [platform] Fix installing HelmReleases on initial setup by kvaps · Pull Request #833 · cozystack/cozystack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[platform] Fix installing HelmReleases on initial setup #833

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 22, 2025

Conversation

kvaps
Copy link
Member
@kvaps kvaps commented Apr 22, 2025

fixes #832

This PR fixes regression on installing helmreleases, also some refactor

Signed-off-by: Andrei Kvapil kvapss@gmail.com

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps kvaps requested a review from lllamnyp as a code owner April 22, 2025 07:51
Copy link
Contributor
coderabbitai bot commented Apr 22, 2025

Walkthrough

This update modifies the HelmRelease template within the core platform package. The main change introduces an explicit check for the availability of the "helm.toolkit.fluxcd.io/v2" API version before performing a HelmRelease lookup, ensuring the lookup is only executed when the API is present in the cluster. Additionally, the template's indentation is refined for improved formatting consistency. No changes are made to exported or public function or data structure signatures.

Changes

File(s) Change Summary
packages/core/platform/templates/helmreleases.yaml Added an API version check before HelmRelease lookup; improved indentation and formatting throughout template

Sequence Diagram(s)

sequenceDiagram
    participant Template as HelmRelease Template
    participant Cluster as Kubernetes Cluster

    Template->>Cluster: Check if API version "helm.toolkit.fluxcd.io/v2" is available
    alt API version available
        Template->>Cluster: Perform HelmRelease lookup
        Template->>Template: Process lookup result
    else API version not available
        Template->>Template: Skip HelmRelease lookup
    end
Loading

Possibly related PRs

Suggested labels

ok-to-test

Suggested reviewers

  • lllamnyp
  • klinch0

Poem

In the warren, code aligns with care,
Indents tidy, logic rare.
API checks before we leap,
Guarding lookups, secrets keep.
With every hop, templates shine—
HelmReleases safe, by design!
🐇✨


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 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
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: 0

🧹 Nitpick comments (3)
packages/core/platform/templates/helmreleases.yaml (3)

10-10: Correctly collecting dependency namespaces
Using set with the blank identifier to build the $dependencyNamespaces map is the appropriate Helm pattern. The YAMLlint warning about “too many spaces after hyphen” here is a false positive caused by Helm’s {{- trimming syntax and can be safely ignored or suppressed.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 10-10: too many spaces after hyphen

(hyphens)


18-23: Guarding deletion lookup with API version check
Introducing the .Capabilities.APIVersions.Has "helm.toolkit.fluxcd.io/v2" guard before calling lookup ensures you won’t trigger runtime errors in clusters without the Flux v2 API. This change aligns perfectly with the PR’s goal to fix initial setup behavior. As above, you can disregard YAMLlint’s hyphen‐spacing warnings on these lines.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 18-18: too many spaces after hyphen

(hyphens)


[warning] 19-19: too many spaces after hyphen

(hyphens)


[warning] 20-20: too many spaces after hyphen

(hyphens)


[warning] 21-21: too many spaces after hyphen

(hyphens)


[warning] 22-22: too many spaces after hyphen

(hyphens)


[warning] 23-23: too many spaces after hyphen

(hyphens)


87-92: Filtering dependsOn entries against disabled components
The updated loop now skips any dependency listed in $disabledComponents, preventing unwanted cross-chart dependencies. The YAMLlint “too many spaces after hyphen” warnings on these templating lines can be ignored or disabled in your linter config.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5903bbc and be84fc6.

📒 Files selected for processing (1)
  • packages/core/platform/templates/helmreleases.yaml (3 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
packages/core/platform/templates/helmreleases.yaml

[warning] 10-10: too many spaces after hyphen

(hyphens)


[warning] 18-18: too many spaces after hyphen

(hyphens)


[warning] 19-19: too many spaces after hyphen

(hyphens)


[warning] 20-20: too many spaces after hyphen

(hyphens)


[warning] 21-21: too many spaces after hyphen

(hyphens)


[warning] 22-22: too many spaces after hyphen

(hyphens)


[warning] 23-23: too many spaces after hyphen

(hyphens)

🔇 Additional comments (2)
packages/core/platform/templates/helmreleases.yaml (2)

64-64: Merging chart-level values into rendering context
Merging the inline .Values into the $values dictionary preserves default‐then‐override semantics and follows established Helm best practices.


67-67: Merging ConfigMap-sourced values correctly
By merging the fromYaml output into $values, you ensure external overrides from the ConfigMap take effect after the chart defaults. This is a solid addition.

@kvaps kvaps changed the title Fix: installing HelmReleases on initial setup [platform] Fix installing HelmReleases on initial setup Apr 22, 2025
@lllamnyp lllamnyp merged commit 57ca60c into main Apr 22, 2025
8 of 9 checks passed
@lllamnyp lllamnyp deleted the fix-hr-regression branch April 22, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression introduced in last 2 commits for helmreleases.yaml
3 participants
0