Skip to content

Commit 4e09edc

Browse files
mabulguclaude
andcommitted
Fix lint errors in credential redaction code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: mabulgu <mabulgu@gmail.com>
1 parent f02b28b commit 4e09edc

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

pkg/provisioner/ironic/clients/updateopts.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ func getUpdateOperation(name string, currentData map[string]any, desiredValue an
108108
logValue = "<redacted>"
109109
}
110110
if present {
111-
oldValue := any(current)
111+
oldLogValue := sanitisedValue(current)
112112
if isSensitiveOption(name) {
113-
oldValue = "<redacted>"
113+
oldLogValue = "<redacted>"
114114
}
115115
log.Info("updating option data",
116116
"value", logValue,
117-
"oldValue", oldValue)
117+
"oldValue", oldLogValue)
118118
} else {
119119
log.Info("adding option data",
120120
"value", logValue)

pkg/provisioner/ironic/clients/updateopts_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -463,16 +463,16 @@ func TestSanitisedValue(t *testing.T) {
463463
}
464464

465465
unsafe := map[string]any{
466-
"foo": "bar",
467-
"password": "secret",
468-
"ipmi_password": "secret",
469-
"image_pull_secret": "dXNlcjpwYXNz",
466+
"foo": "bar",
467+
"password": "secret",
468+
"ipmi_password": "secret",
469+
"image_pull_secret": "dXNlcjpwYXNz",
470470
}
471471
safe := map[string]any{
472-
"foo": "bar",
473-
"password": "<redacted>",
474-
"ipmi_password": "<redacted>",
475-
"image_pull_secret": "<redacted>",
472+
"foo": "bar",
473+
"password": "<redacted>",
474+
"ipmi_password": "<redacted>",
475+
"image_pull_secret": "<redacted>",
476476
}
477477
assert.Exactly(t, safe, sanitisedValue(unsafe))
478478
}

0 commit comments

Comments
 (0)