-
Notifications
You must be signed in to change notification settings - Fork 187
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
Mask the Kubernetes Secrets data from dry-run and apply logs #420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michalschott this is good start, can you please write some tests to ensure we don't replace all the lines in the error string? For a Kustomization that includes an invalid Secret, ConfigMap and Deployment only the Secret data should be replaced.
Hey, Just pushed an update / rebase. Now output looks like this:
Having tests would be useful indeed, will see what can I do. UPDATE: |
Signed-off-by: Michal Schott <michal.schott@onegini.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michalschott malformed secrets will not pass validation, can you please use stripSensitiveData
for the validation error also?
Signed-off-by: Michal Schott <michal.schott@onegini.com>
Good spot, actioned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @michalschott 🏅
@@ -77,3 +79,14 @@ func containsString(slice []string, s string) bool { | |||
} | |||
return false | |||
} | |||
|
|||
func stripSensitiveData(err error) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not important for this PR, as we are foreseeing that it will be refactored soon (or handled differently), but in cases like this I would pick maskSensitiveData
over the current function name.
As a strip would literally take all data out, instead of replacing (= masking) it.
Different approach to fix #419