func GetIgnoredLabelAnnotationInPod()

in pkg/common/utils/utils.go [216:237]


func GetIgnoredLabelAnnotationInPod(pod *v1.Pod, currentValue string, labelKeys []string, annotationKeys []string) (map[string]string, map[string]string) {
	ignoredLabel := make(map[string]string, 0)
	ignoredAnnotation := make(map[string]string, 0)

	for _, key := range labelKeys {
		value := GetPodLabelValue(pod, key)
		if value == "" || value == currentValue {
			continue
		}
		ignoredLabel[key] = value
	}

	for _, key := range annotationKeys {
		value := GetPodAnnotationValue(pod, key)
		if value == "" || value == currentValue {
			continue
		}
		ignoredAnnotation[key] = value
	}

	return ignoredLabel, ignoredAnnotation
}