Fix comment about reasoning to error if not writable

Signed-off-by: Scott Rigby <scott@r6by.com>
pull/30924/head
Scott Rigby 4 months ago
parent 1eb6cf851f
commit b36c14c62c
No known key found for this signature in database
GPG Key ID: C7C6FBB5B91C1155

@ -109,10 +109,11 @@ func handleEmptyConfgFile(credentialsFile string, client *Client) string {
// handle only if credentials file is empty // handle only if credentials file is empty
if err := json.NewDecoder(f).Decode(&configData); err != nil && !errors.Is(err, io.EOF) { if err := json.NewDecoder(f).Decode(&configData); err != nil && !errors.Is(err, io.EOF) {
// Attempt to write empty JSON map to config file // Attempt to write empty JSON map to config file
// Note that <3.18.0
client.credentialsFile = "" client.credentialsFile = ""
encoder := json.NewEncoder(f) encoder := json.NewEncoder(f)
err = encoder.Encode(configData) 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 { if err != nil {
client.err = err client.err = err
} }

Loading…
Cancel
Save