-
Notifications
You must be signed in to change notification settings - Fork 25
Update ignoreDeletionMarksDelay based on deleteDelay #61
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: master
Are you sure you want to change the base?
Conversation
0317acb to
c018219
Compare
jsonnet/obs-operator.jsonnet
Outdated
| stores+:: { | ||
| local deleteDelay = if std.objectHas(cr.spec, 'compact') && std.objectHas(cr.spec.compact, 'deleteDelay') then cr.spec.compact.deleteDelay else obs.thanos.compact.config.deleteDelay, | ||
| securityContext: if std.objectHas(cr.spec, 'securityContext') then cr.spec.securityContext else obs.thanos.stores.config.securityContext, | ||
| ignoreDeletionMarksDelay: std.parseInt(std.substr(deleteDelay, 0, std.length(deleteDelay)-1))/2 + std.substr(deleteDelay, std.length(deleteDelay)-1, std.length(deleteDelay)), |
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.
this has some potential weird edge cases. If someone typed 1d for the deletion delay, then we would try to parse the int 1/2, which would result in 0d. This seems slightly dangerous to do in the operator code since the code runs automatically unlike when using plain jsonnet without an operator where users have the chance to review the generated manifests before applying
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.
so do you mean that we should expose ignoreDeletionMarksDelay for customer to set?
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.
yes, I think this would be a good way to start working around this for now. Otherwise we need to move parsing somewhere like golang
9df4456 to
f0fd4da
Compare
|
@squat PTAL. Thanks. |
squat
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 make sure these connects always end with a period for consistency
Signed-off-by: clyang82 <[email protected]>
Signed-off-by: clyang82 <[email protected]>
Co-authored-by: Lucas Servén Marín <[email protected]>
Co-authored-by: Lucas Servén Marín <[email protected]>
Signed-off-by: clyang82 <[email protected]>
df2bc67 to
da26779
Compare
|
@squat PTAL |
Set
configure --ignore-deletion-marks-delayto (delete-delay)/2Here is description from document:
Signed-off-by: clyang82 [email protected]