pbacsko commented on code in PR #474:
URL: https://github.com/apache/yunikorn-k8shim/pull/474#discussion_r1023893996
##########
pkg/common/utils/utils.go:
##########
@@ -257,3 +259,109 @@ func GetUserFromPod(pod *v1.Pod) string {
return value
}
+
+func GetPodAnnotationValue(pod *v1.Pod, annotationKey string) string {
+ if value, ok := pod.Annotations[annotationKey]; ok {
+ return value
+ }
+ return ""
Review Comment:
Nit: {{""}} is used as a magic value. Consider using a constant called
{{none}}.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]