pbacsko commented on code in PR #474:
URL: https://github.com/apache/yunikorn-k8shim/pull/474#discussion_r1023896662


##########
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 ""
+}
+
+func GetNameSpaceAnnotationValue(namespace *v1.Namespace, annotationKey 
string) string {
+       if value, ok := namespace.Annotations[annotationKey]; ok {
+               return value
+       }
+       return ""
+}
+
+func GetPodLabelValue(pod *v1.Pod, labelKey string) string {
+       if value, ok := pod.Labels[labelKey]; ok {
+               return value
+       }
+       return ""
+}
+
+func GetTaskGroupFromPodSpec(pod *v1.Pod) string {
+       return GetPodAnnotationValue(pod, constants.AnnotationTaskGroupName)
+}
+
+func GetPlaceholderFlagFromPodSpec(pod *v1.Pod) bool {

Review Comment:
   This function is not covered by unit tests. As I can see, it was missing in 
the original code.
   Please write one to enhance coverage.



-- 
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]

Reply via email to