func PodNamespaceAnnotations()

in kubernetes/util.go [318:338]


func PodNamespaceAnnotations(pod *Pod, watcher Watcher) mapstr.M {
	if watcher == nil {
		return nil
	}

	rawNs, ok, err := watcher.Store().GetByKey(pod.Namespace)
	if !ok || err != nil {
		return nil
	}

	namespace, ok := rawNs.(*Namespace)
	if !ok {
		return nil
	}

	annotations := mapstr.M{}
	for k, v := range namespace.GetAnnotations() {
		_ = safemapstr.Put(annotations, k, v)
	}
	return annotations
}