Skip to content

refactor: eliminate hidden mutations in HelmRepository client opts #1853

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cappyzawa
Copy link
Contributor

@cappyzawa cappyzawa commented Jul 25, 2025

Summary

Refactors HelmRepository client options generation to use explicit configuration pattern. The previous implementation had hidden mutable side effects where ClientOpts was modified through configuration functions, making the code harder to reason about.

Changes

  • Replace hidden mutation functions with explicit configuration pattern
  • Add CertsTempDir field to ClientOpts and update GetClientOpts signature to return (*ClientOpts, error) instead of (*ClientOpts, string, error)
    • Update all callers to use clientOpts.CertsTempDir
  • Improve error messages to include namespace/name for better debugging

Related

Addresses similar error message clarity issues identified in #1852 (comment)

Replace hidden mutation functions with explicit configuration
pattern to eliminate side effects where ClientOpts was modified
through configuration functions. Adds CertsTempDir field to ClientOpts struct.

Signed-off-by: cappyzawa <[email protected]>
@cappyzawa cappyzawa force-pushed the refactor/helm-repository-client-opts-option-pattern branch from 8f8ad70 to df06de9 Compare July 25, 2025 04:39
@cappyzawa cappyzawa changed the title refactor: use builder pattern in HelmRepository client opts refactor: eliminate hidden mutations in HelmRepository client opts Jul 25, 2025
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