func getVolumeMountsInExistingContainers()

in appconfigmgrv2/api/webhooks/builtins/common.go [118:131]


func getVolumeMountsInExistingContainers(pod *corev1.Pod) *corev1.VolumeMount {
	log.V(1).Info("getVolumeMountsInExistingContainers", "volumeName", pod.Name)

	for _, c := range pod.Spec.Containers {
		for _, vm := range c.VolumeMounts {
			if vm.MountPath == "/var/run/secrets/kubernetes.io/serviceaccount" {
				return vm.DeepCopy()
			}
		}
	}

	return nil

}