-
Notifications
You must be signed in to change notification settings - Fork 161
[#289] feat(operator): Support annotations #1817
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
Conversation
@advancedxy Could you help me review this pull request? |
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 continuing this work. It looks good to me generally.
for key, value := range reservedAnnotations { | ||
annotations[key] = value | ||
} | ||
|
||
for key, value := range rss.Spec.ShuffleServer.Annotations { | ||
if _, exist := reservedAnnotations[key]; !exist { | ||
annotations[key] = value | ||
} | ||
} |
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.
Nit: it might be clearer to override by reservedAnnotations, such as:
for key, value := range rss.Spec.ShuffleServer.Annotations {
annotations[key] = value
}
// reserved annotations have higher preference.
for key, value := range reservedAnnotations {
annotations[key] = value
}
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.
testAnnotations = map[string]string{ | ||
"key1": "value1", | ||
"key2": "value2", | ||
} |
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.
could we also add a test case with reserved one, so that we can make sure the override logic is correct.
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.
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. Pending CI passes.
What changes were proposed in this pull request?
Previous pull request is #467
I address the comments and add the uts.
Why are the changes needed?
Fix: #289
Does this PR introduce any user-facing change?
No.
How was this patch tested?
UT and run the operator in the GKE.