refactor: eliminate hidden mutations in HelmRepository client opts#1853
refactor: eliminate hidden mutations in HelmRepository client opts#1853cappyzawa wants to merge 1 commit intofluxcd:mainfrom
Conversation
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]>
8f8ad70 to
df06de9
Compare
|
@cappyzawa can you please rebase and solve conflicts, would be great to get this merged. |
|
Previously, I discussed refactoring with @matheuscscp once helm/helm#31076 was merged and available, but I forgot to mention it here—sorry about that. Since it looks like helm/helm#31076 is still planned only for Helm 4 and there haven’t been any updates, I suppose any improvements to this PR will have to wait until then. |
|
Yeah I think we can wait until we can remove this tmp dir altogether to merge this one |
|
@cappyzawa The initial (and probably most substantial) Helm 4 PR has been merged: Feel free to check if this one is still relevant 👌 |
|
Thanks for the ping @matheuscscp! I checked how the Helm 4 migration addressed the issues this PR was trying to solve:
Since the Helm 4 + ORAS v2 migration solved these issues with a cleaner architecture, I'll close this PR. |
Summary
Refactors HelmRepository client options generation to use explicit configuration pattern. The previous implementation had hidden mutable side effects where
ClientOptswas modified through configuration functions, making the code harder to reason about.Changes
CertsTempDirfield toClientOptsand updateGetClientOptssignature to return(*ClientOpts, error)instead of(*ClientOpts, string, error)clientOpts.CertsTempDirRelated
Addresses similar error message clarity issues identified in #1852 (comment)