-
Notifications
You must be signed in to change notification settings - Fork 44
[AWS CIS] Change logging non blocking errors to warning #3862
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
base: main
Are you sure you want to change the base?
Conversation
|
This pull request does not have a backport label. Could you fix it @romulets? 🙏
|
amirbenun
left a comment
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.
Let's have more clarity on the errors that are returned from AWS SDK.
dbe86ab to
f4fdd05
Compare
f4fdd05 to
7f48e4c
Compare
| return | ||
| } | ||
| errMsg := err.Error() | ||
| if strings.Contains(errMsg, "NoSuchBucket") { |
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.
Instead of strings comparison
var nsb *types.NoSuchBucket
if errors.As(err, &nsb) {
p.log.Warnf("Error getting bucket %s for bucket %s: %v", operation, bucketName, err)
return
}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.
Done
amirbenun
left a comment
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.
Nice!
The changed log lines are over alerting right now, it should be a warn instead of error