Skip to content

feat: Add reading helm username and password from a secret#95

Merged
danielpanzella merged 3 commits intomainfrom
danielpanzella/infra-321-helm-chart-pull-with-authentication
Jul 2, 2025
Merged

feat: Add reading helm username and password from a secret#95
danielpanzella merged 3 commits intomainfrom
danielpanzella/infra-321-helm-chart-pull-with-authentication

Conversation

@danielpanzella
Copy link
Copy Markdown
Contributor

@danielpanzella danielpanzella commented Jul 2, 2025

Summary by CodeRabbit

  • New Features

    • Added support for retrieving Helm repository credentials from Kubernetes Secrets, enhancing secure credential management.
  • Chores

    • Expanded permissions for batch jobs and cronjobs to include creation, deletion, and patching alongside existing read and watch capabilities.
    • Updated Helm chart version and disabled Redis authentication in the default configuration.
  • Tests

    • Introduced comprehensive tests for handling Helm repository credentials sourced from Kubernetes Secrets, covering various credential scenarios and error handling.

@linear
Copy link
Copy Markdown

linear Bot commented Jul 2, 2025

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 2, 2025

Walkthrough

The changes expand RBAC permissions for batch resources by adding "create," "delete," and "patch" verbs to both configuration and controller files. Additionally, Helm repository credential handling is enhanced to support fetching credentials from Kubernetes Secrets via a new struct and logic in the chart repository code. The test suite is extended to cover these new credential secret scenarios. The Helm chart version and Redis auth settings were also updated in a manifest file.

Changes

File(s) Change Summary
config/rbac/role.yaml
controllers/weightsandbiases_controller.go
Expanded RBAC verbs for "cronjobs" and "jobs" to include "create," "delete," and "patch".
pkg/wandb/spec/charts/repo.go
pkg/wandb/spec/charts/repo_test.go
Added support for Helm repo credentials via Kubernetes Secret using new struct, fields, logic, and extended tests.
hack/testing-manifests/wandb/default.yaml Updated Helm chart version from 0.26.3 to 0.32.4 and disabled Redis authentication by removing auth.enabled: true.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant RepoRelease
    participant KubernetesAPI
    participant Secret

    User->>RepoRelease: Apply()
    alt CredentialSecret provided
        RepoRelease->>KubernetesAPI: Get Secret (CredentialSecret.Name)
        KubernetesAPI-->>RepoRelease: Secret object
        RepoRelease->>Secret: Extract username/password (using keys)
        RepoRelease->>RepoRelease: Override plain credentials
    else No CredentialSecret
        RepoRelease->>RepoRelease: Use plain username/password fields
    end
    RepoRelease->>User: Continue Helm repo logic
Loading

Poem

In the meadow of code where permissions grow,
New verbs were added—create, patch, and throw!
Secrets now whisper credentials with care,
Helm charts fetch passwords from Kubernetes air.
With every new struct, the garden expands—
A rabbit hops forward with gentle commands.
🐇✨


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
Copy Markdown

@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)
hack/testing-manifests/wandb/default.yaml (1)

61-67: Redis is installed without authentication – confirm this is intentional for test clusters
Previous test manifests enabled redis.auth.enabled: true; dropping it exposes the instance unauthenticated. If that’s unintended, add the flag back or inject a test password via values.redis.auth.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9c0b140 and 8cb9a03.

📒 Files selected for processing (1)
  • hack/testing-manifests/wandb/default.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: zacharyblasczyk
PR: wandb/operator#0
File: :0-0
Timestamp: 2025-02-24T15:05:30.333Z
Learning: When handling Helm chart downloads, proper configuration of both repository-level settings (entry.Username/Password) and getter-level options (WithBasicAuth) is essential for authentication to work correctly.
Learnt from: zacharyblasczyk
PR: wandb/operator#0
File: :0-0
Timestamp: 2025-02-24T15:05:30.333Z
Learning: The chart repository authentication in the operator requires both repository-level credential setup (entry.Username/Password) and getter-level authentication (getter.WithBasicAuth) to ensure proper authentication for all registry interactions.
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test
  • GitHub Check: Build

Comment thread hack/testing-manifests/wandb/default.yaml
@danielpanzella danielpanzella merged commit 41e76ab into main Jul 2, 2025
10 checks passed
@danielpanzella danielpanzella deleted the danielpanzella/infra-321-helm-chart-pull-with-authentication branch July 2, 2025 21:27
jsbroks pushed a commit that referenced this pull request Jul 2, 2025
## [1.20.0](v1.19.3...v1.20.0) (2025-07-02)

### Features

* Add reading helm username and password from a secret ([#95](#95)) ([41e76ab](41e76ab))
@jsbroks
Copy link
Copy Markdown
Member

jsbroks commented Jul 2, 2025

This PR is included in version 1.20.0 🎉

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.

3 participants