Skip to content

chore(base-cluster): change descheduler syntax #1483

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
May 28, 2025

Conversation

cwrau
Copy link
Member

@cwrau cwrau commented May 26, 2025

Summary by CodeRabbit

  • Refactor
    • Improved the logic for selecting the descheduler chart version, making it more dynamic and flexible based on the Kubernetes minor version.
    • Updated version mappings to use semantic versioning patterns for easier maintenance and clarity in configuration.

@Copilot Copilot AI review requested due to automatic review settings May 26, 2025 14:42
Copy link

coderabbitai bot commented May 26, 2025

Warning

Rate limit exceeded

@cwrau has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e0f6ddc and 0665e01.

📒 Files selected for processing (2)
  • charts/base-cluster/templates/descheduler/descheduler.yaml (2 hunks)
  • charts/base-cluster/values.yaml (1 hunks)

Walkthrough

The changes update the descheduler Helm chart version selection mechanism from a static, version-specific mapping to a dynamic, pattern-based lookup. The values.yaml file is restructured to use semantic versioning keys, and the template logic is simplified to select the appropriate version based on the Kubernetes minor version.

Changes

File(s) Change Summary
charts/base-cluster/templates/descheduler/descheduler.yaml Replaced static version matrix with dynamic, pattern-based version selection logic in the template.
charts/base-cluster/values.yaml Updated descheduler chart version mappings to use semantic versioning keys and values.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HelmRelease Template
    participant Values.yaml

    User->>HelmRelease Template: Deploy descheduler
    HelmRelease Template->>Values.yaml: Retrieve Kubernetes minor version
    HelmRelease Template->>Values.yaml: Lookup "descheduler 0.<minor>.x" version key
    alt Key exists
        Values.yaml-->>HelmRelease Template: Return specific version
    else Key missing
        Values.yaml-->>HelmRelease Template: Return default descheduler version
    end
    HelmRelease Template->>User: Deploys with selected version
Loading

Suggested reviewers

  • marvinWolff
  • tasches

Poem

A bunny hopped through YAML fields,
Where version keys now yield,
No more static, rigid lines—
Dynamic lookups, oh how fine!
With patterns clear and charts anew,
The descheduler hops right through.
🐇✨


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.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the descheduler configuration syntax in the base-cluster chart. The changes update the chart keys in the values file to use a new naming convention and adjust the template logic for selecting the appropriate descheduler version.

  • Updated chart keys in values.yaml from "descheduler_27/28/29" to "descheduler 0.X.x"
  • Refactored version selection logic in the descheduler template using a formatted key lookup

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
charts/base-cluster/values.yaml Updated descheduler chart keys to new naming format
charts/base-cluster/templates/descheduler/descheduler.yaml Modified version lookup logic to match the new key naming convention
Comments suppressed due to low confidence (1)

charts/base-cluster/templates/descheduler/descheduler.yaml:3

  • Ensure that the new lookup for descheduler chart versions correctly handles all expected Kubernetes minor versions; consider adding tests to validate the key resolution and fallback behavior.
{{- with (index . (printf "descheduler 0.%d.x" ($.Capabilities.KubeVersion.Minor | int))) -}}

Copy link

@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 (2)
charts/base-cluster/templates/descheduler/descheduler.yaml (1)

3-4: Ensure robust conversion of Kubernetes minor version
If .Capabilities.KubeVersion.Minor ever contains non-digits (e.g., “29+”), the | int cast can fail. Consider stripping non-numeric characters before conversion:

-  {{- with (index . (printf "descheduler 0.%d.x" ($.Capabilities.KubeVersion.Minor | int))) -}}
+  {{- $minor := regexReplaceAll "[^0-9]" $.Capabilities.KubeVersion.Minor | int -}}
+  {{- with (index . (printf "descheduler 0.%d.x" $minor)) -}}
🧰 Tools
🪛 YAMLlint (1.37.1)

[warning] 4-4: wrong indentation: expected 0 but found 4

(indentation)

charts/base-cluster/values.yaml (1)

124-126: Quote multi-word keys in the charts.descheduler mapping
YAML keys containing spaces should be quoted to avoid parsing ambiguities:

-charts:
-  descheduler: 0.32.2
-  descheduler 0.29.x: 0.31.2
-  descheduler 0.28.x: 0.30.2
-  descheduler 0.27.x: 0.29.0
+charts:
+  descheduler: 0.32.2
+  "descheduler 0.29.x": 0.31.2
+  "descheduler 0.28.x": 0.30.2
+  "descheduler 0.27.x": 0.29.0
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f62b197 and 6266ca6.

📒 Files selected for processing (2)
  • charts/base-cluster/templates/descheduler/descheduler.yaml (1 hunks)
  • charts/base-cluster/values.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
charts/base-cluster/templates/descheduler/descheduler.yaml

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

(syntax)


[warning] 4-4: wrong indentation: expected 0 but found 4

(indentation)


[warning] 5-5: wrong indentation: expected 0 but found 2

(indentation)


[warning] 6-6: wrong indentation: expected 0 but found 4

(indentation)


[warning] 7-7: wrong indentation: expected 0 but found 2

(indentation)

🪛 GitHub Actions: Lint Helm Charts
charts/base-cluster/templates/descheduler/descheduler.yaml

[error] 6-6: Template parse error: function "descheduler" not defined.

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: generateDiffCommentBody
  • GitHub Check: wait-for-checks

@teutonet-bot
Copy link
Contributor

teutonet-bot commented May 26, 2025

🤖 I have diffed this beep boop

"/$namespace/$kind/$name.yaml" for normal resources
"/$namespace/HelmRelease/$name/$namespace/$kind/$name.yaml" for HelmReleases <- this is recursive
'null' means it's either cluster-scoped or it's in the default namespace for the HelmRelease

charts/base-cluster/ci/monitoring-ingress-unauthenticated-values.yaml

[charts/base-cluster/ci/rbac-values.yaml]({"errors": ["Missing required field 'content'"]})

charts/base-cluster/ci/pagerduty-values.yaml

charts/base-cluster/ci/velero-backupStorageLocations-gen-values.yaml

charts/base-cluster/ci/flux-gitrepositories-gen-values.yaml

charts/base-cluster/ci/traefik-ingress-values.yaml

[charts/base-cluster/ci/imagepullsecrets-values.yaml]({"errors": ["Missing required field 'content'"]})

[charts/base-cluster/values.yaml]({"errors": ["Missing required field 'content'"]})

[charts/base-cluster/ci/artifacthub-values.yaml]({"errors": ["Missing required field 'content'"]})

charts/base-cluster/ci/disabled-ingress-values.yaml

charts/base-cluster/ci/priorityclasses-values.yaml

[charts/base-cluster/ci/deadmansswitch-values.yaml](

<title> Error </title> <script src="https://unpkg.com/[email protected]" integrity="sha384-Y7hw+L/jvKeWIRRkqWYfPcvVxHzVzn5REgzbawhxAuQGwX1XWe70vji+VSeHOThJ" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script defer src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script> <script> function key(event, letter) { return (event.charCode == letter.charCodeAt() || event.charCode == letter.charCodeAt() + 32) } </script> <script>
    </script>
    <style></style>
    
    
</head>

<body hx-on:keydown="var path=window.location.pathname; if ((event.key=='n' || event.key=='N') && path && path !== '/' && !path.includes('/duplicate/') && !path.includes('/dashboard/') && !path.includes('/accounts/') && !path.includes('/properties/')) { window.location.href = '/'; }">
    <div id="container">
        
        <div class="topbuttons">
            
                <a href="/accounts/login/"
                   title="Personal dashboard, preferences, API token"
                   class="button"><b>Sign in</b></a>
            
            <a href="/" title="Create a new paste (shortcut: 'N')" class=" button">New</a>
            <a href="/api/v2/"
               title="Paste creation API, with code samples"
               class=" activebutton  button">API</a>
            <a href="/help/"
               title="Usage tips, shortcuts"
               class="  button">Help</a>
            <a href="/about/"
               title="Updates, stats, backstory"
               class=" button">About</a>
        </div>
        
<div class="error">
    <h3>Sorry!</h3>
    Sorry, maximum content size is 1,000,000 characters. Your submission is 2,537,409. Your IP will be blocked if you exceed this limit again in the next 60 seconds.
    <hr>
    <p>
        Something unexpected? Please create a <a href="https://dpaste.freshdesk.com/support/tickets/new">support ticket</a>.
    </p>
</div>
<p>
    <a class="button" href="{$ url 'create' %}" onclick="history.back();return false;">Go back</a>
</p>

    </div>
    
    
    <script>
        window.fwSettings={'widget_id':22000000180 };
        !function(){if("function"!=typeof window.FreshworksWidget){var n=function(){n.q.push(arguments)};n.q=[],window.FreshworksWidget=n}}();
    </script>
    <script defer src='https://widget.freshworks.com/widgets/22000000180.js'></script>
</body>
)

charts/base-cluster/ci/monitoring-oidc-values.yaml

[charts/base-cluster/ci/basic-values.yaml]({"errors": ["Missing required field 'content'"]})

charts/base-cluster/ci/monitoring-oidc-ingress-disabled-values.yaml

charts/base-cluster/ci/limitrange-resourcequota-values.yaml

@cwrau cwrau force-pushed the chore/base-cluster/change-descheduler-syntax branch from 6266ca6 to e0f6ddc Compare May 27, 2025 07:47
Copy link

@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

🔭 Outside diff range comments (1)
charts/base-cluster/templates/descheduler/descheduler.yaml (1)

61-61: ⚠️ Potential issue

Remove extraneous {{- end -}}
The trailing {{- end -}} on this line isn’t closing any open block, causing a Helm parse error during linting. Please remove it:

-  {{- end -}}
🧰 Tools
🪛 GitHub Actions: Lint Helm Charts

[error] 61-61: Helm lint error: parse error at line 61 - unexpected {{end}}

♻️ Duplicate comments (1)
charts/base-cluster/templates/descheduler/descheduler.yaml (1)

5-7: Fallback lookup quoting reminder
You've correctly quoted the "descheduler" key in the fallback to avoid Helm parsing it as a function. This matches the previous recommendation to fix the parser error.

🧰 Tools
🪛 YAMLlint (1.37.1)

[warning] 5-5: wrong indentation: expected 0 but found 2

(indentation)


[warning] 6-6: wrong indentation: expected 0 but found 4

(indentation)


[warning] 7-7: wrong indentation: expected 0 but found 2

(indentation)

🧹 Nitpick comments (1)
charts/base-cluster/templates/descheduler/descheduler.yaml (1)

1-4: Ensure fallback handling for missing chart mappings and simplify version lookup
Initializing $selectedVersion to an empty string will lead to an invalid version: if .Values.global.helmRepositories.descheduler.charts is unset or empty. You can both enforce the presence of the chart map and collapse the nested with/else into a single default call:

-{{- $selectedVersion := "" -}}
-{{- with .Values.global.helmRepositories.descheduler.charts -}}
-  {{- with (index . (printf "descheduler 0.%d.x" ($.Capabilities.KubeVersion.Minor | int))) -}}
-    {{- $selectedVersion = . -}}
-  {{- else -}}
-    {{- $selectedVersion = index . "descheduler" -}}
-  {{- end -}}
-{{- end -}}
+{{- $charts := required "global.helmRepositories.descheduler.charts must be set" .Values.global.helmRepositories.descheduler.charts -}}
+{{- $key := printf "descheduler 0.%d.x" ($.Capabilities.KubeVersion.Minor | int) -}}
+{{- $selectedVersion := default (index $charts "descheduler") (index $charts $key) -}}
🧰 Tools
🪛 YAMLlint (1.37.1)

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

(syntax)


[warning] 4-4: wrong indentation: expected 0 but found 4

(indentation)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6266ca6 and e0f6ddc.

📒 Files selected for processing (2)
  • charts/base-cluster/templates/descheduler/descheduler.yaml (1 hunks)
  • charts/base-cluster/values.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • charts/base-cluster/values.yaml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
charts/base-cluster/templates/descheduler/descheduler.yaml

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

(syntax)


[warning] 4-4: wrong indentation: expected 0 but found 4

(indentation)


[warning] 5-5: wrong indentation: expected 0 but found 2

(indentation)


[warning] 6-6: wrong indentation: expected 0 but found 4

(indentation)


[warning] 7-7: wrong indentation: expected 0 but found 2

(indentation)

🪛 GitHub Actions: Lint Helm Charts
charts/base-cluster/templates/descheduler/descheduler.yaml

[error] 61-61: Helm lint error: parse error at line 61 - unexpected {{end}}

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: generateDiffCommentBody
  • GitHub Check: wait-for-checks

@cwrau cwrau force-pushed the chore/base-cluster/change-descheduler-syntax branch from e0f6ddc to 0665e01 Compare May 27, 2025 07:59
@cwrau cwrau added this pull request to the merge queue May 28, 2025
Merged via the queue into main with commit 907bdae May 28, 2025
41 checks passed
@cwrau cwrau deleted the chore/base-cluster/change-descheduler-syntax branch May 28, 2025 11:14
github-merge-queue bot pushed a commit that referenced this pull request Jun 6, 2025
🤖 I have created a release *beep* *boop*
---


##
[8.1.0](base-cluster-v8.0.0...base-cluster-v8.1.0)
(2025-06-06)


### Features

* **base-cluster/monitoring:** allow upsizing tempo storage
([#1448](#1448))
([db1a742](db1a742))
* **base-cluster/monitoring:** also read secrets for datasources
([#1479](#1479))
([83ba8bd](83ba8bd))
* **base-cluster/monitoring:** configure service graph for grafana
([#1422](#1422))
([8d4bb4c](8d4bb4c))
* **base-cluster/monitoring:** set code challenge for grafana
([#1500](#1500))
([aa803da](aa803da))
* **base-cluster/monitoring:** set code_challenge_method for
oauth2-proxy
([#1496](#1496))
([b252cd7](b252cd7))


### Bug Fixes

* **base-cluster:** this prevents the user from installing this under
another name
([#1418](#1418))
([f4807e8](f4807e8))


### Miscellaneous Chores

* **base-cluster/docs:** update flux helmrelease command to update CRDs
([#1421](#1421))
([a8fd535](a8fd535))
* **base-cluster/monitoring:** remove unnecessary
open-telemetry-collector dashboard
([#1449](#1449))
([520e9e1](520e9e1))
* **base-cluster:** change descheduler syntax
([#1483](#1483))
([907bdae](907bdae))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
  - Enhanced monitoring with support for upsizing tempo storage.
- Enabled reading secrets for datasources and configuring the service
graph in Grafana.
- Added options to set the code challenge and code_challenge_method for
Grafana and oauth2-proxy.
- Introduced an optional persistence configuration for tracing ingester
storage size.

- **Bug Fixes**
- Resolved an issue preventing installation of the chart under
unintended names.

- **Chores**
  - Updated helmrelease command for CRD updates.
  - Removed an unnecessary dashboard and adjusted descheduler syntax.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants