-
Notifications
You must be signed in to change notification settings - Fork 812
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
Ignore objects with names that end with / when listing rule groups #3999
Ignore objects with names that end with / when listing rule groups #3999
Conversation
Signed-off-by: Peter Štibraný <[email protected]>
Signed-off-by: Peter Štibraný <[email protected]>
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.
Thanks for the fix! LGMT
Signed-off-by: Marco Pracucci <[email protected]>
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.
I approved, but I'm doing a step back now. /
is a valid base64 character, so we may have it within the key name as well, which would break the logic anyway. Also having the key with /
at the end may be legit 🤔
Am I missing anything?
We use base64 with "URL" alphabet ( Key with |
Interesting. So, how can we end up with an object ending with |
Objects that we've found are from Aug 2020 and Dec 2020. I suspect that we didn't check for group or namespace names in the past (do we now?). Content of those files is suspicious too -- they don't look like rule group files at all. |
My though is: if such objects are not supposed to be there, should we filter them out (this PR)? I would bet we can break several parts of cortex if the storage contains unexpected objects. |
Signed-off-by: Peter Štibraný <[email protected]>
…s' into rulestore-ignore-empty-groupnames Signed-off-by: Peter Štibraný <[email protected]>
Note that validation for empty group names was added in #3210. |
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.
Looks very good to me, thanks!
What this PR does: This PR changes bucket-client based rule-store implementation to ignore objects that end with
/
. Such objects may exist and would be returned, but would cause failure to load the rule later, which can lead to ruler not loading any rules.Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]