From b36c14c62c7748c3e796ed3e5bf56743fae50dad Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Tue, 27 May 2025 16:22:47 -0400 Subject: [PATCH] Fix comment about reasoning to error if not writable Signed-off-by: Scott Rigby --- pkg/registry/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/registry/client.go b/pkg/registry/client.go index b45c8ed5c..4d6098256 100644 --- a/pkg/registry/client.go +++ b/pkg/registry/client.go @@ -109,10 +109,11 @@ func handleEmptyConfgFile(credentialsFile string, client *Client) string { // handle only if credentials file is empty if err := json.NewDecoder(f).Decode(&configData); err != nil && !errors.Is(err, io.EOF) { // Attempt to write empty JSON map to config file - // Note that <3.18.0 client.credentialsFile = "" encoder := json.NewEncoder(f) err = encoder.Encode(configData) + // Note that <3.18.0 Helm would fail if the config file was not + // writable, so we can continue to error if that is the case if err != nil { client.err = err }