-
Notifications
You must be signed in to change notification settings - Fork 98
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
Fix job annotation overwrite #1612
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.
Not sure the entire context of this, but made some comments and suggestions about wording for at least the changelog if the desire is to add annotations/labels v. overriding them.
), | ||
Annotations: helmette.Merge( | ||
helmette.Default(map[string]string{}, values.PostInstallJob.Annotations), |
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'm guessing that we have this change since we don't want others to be able to override the helm-specific annotations?
Is there a perceived use-case where we want users to be able to override these?
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'm guessing that we have this change since we don't want others to be able to override the helm-specific annotations?
It's other way around. If someone would like to override (not recommended) with this change they will be able to change annotation. Merge from mergo works other way around.
Is there a perceived use-case where we want users to be able to override these?
As in the https://redpandacommunity.slack.com/archives/C01AJDUT88N/p1732833410021669 community member would like to delete Job after they succeed.
helmette.Default(map[string]string{}, values.PostInstallJob.Labels), | ||
FullLabels(dot), |
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.
For this change if PostInstallJob.Labels
is considered an override then shouldn't we allow for overriding FullLabels(dot)
?
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 change does exactly that. It allows for overriding. I will add test case to assert that generated label by the FullLabel
function will be changed if I provide in the same key different label value.
#### Added | ||
#### Changed | ||
#### Fixed | ||
* ability to overwrite annotation and labels in Job metadata |
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.
It seems the current implementation isn't really for overriding, but adding additional labels/annotations that we normally wouldn't set? Basically:
helm-charts/charts/redpanda/values.yaml
Lines 555 to 558 in 05d3182
# -- Additional labels to apply to the Pods of this Job. | |
labels: {} | |
# -- Additional annotations to apply to the Pods of this Job. | |
annotations: {} |
If so, then I think the implementation is fine, but this should be something like:
* ability to overwrite annotation and labels in Job metadata | |
* ability to set additional annotation and labels in Job metadata |
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 change tries to change the set additional
to overwrite
even the default one.
The comment references the podTemplate
helm-charts/charts/redpanda/values.yaml
Lines 554 to 558 in 05d3182
podTemplate: | |
# -- Additional labels to apply to the Pods of this Job. | |
labels: {} | |
# -- Additional annotations to apply to the Pods of this Job. | |
annotations: {} |
Job.Metadata.[Labels/Annotation]
.
b483c4b
to
bd570dc
Compare
aac3d49
Fixed ability to overwrite annotation and labels in Job metadata
b483c4b
Remove none existent post-upgrade-job values
Reference
https://github.com/redpanda-data/helm-charts/releases/tag/redpanda-5.9.6
#1534
helm-charts/CHANGELOG.md
Lines 85 to 92 in 05d3182