func injectEnv(pod *corev1.Pod, env corev1.EnvVar) bool {
	injected := false
	podStr := podString(pod)
	log.Debugf("Injecting env var '%s' into pod %s", env.Name, podStr)
	for i, ctr := range pod.Spec.Containers {
		if contains(ctr.Env, env.Name) {
			log.Debugf("Ignoring container '%s' in pod %s: env var '%s' already exist", ctr.Name, podStr, env.Name)
			continue
		}
		pod.Spec.Containers[i].Env = append(pod.Spec.Containers[i].Env, env)
		injected = true
	}
	return injected
}
// injectEnv injects an env var into a pod template if it doesn't exist
injectEnv injects an env var into a pod template if it doesn't exist
// injectEnv injects an env var into a pod template if it doesn ' t exist
func injectEnv(pod *corev1.Pod, env corev1.EnvVar) bool {
	injected := false
	podStr := podString(pod)
	log.Debugf("Injecting env var '%s' into pod %s", env.Name, podStr)
	for i, ctr := range pod.Spec.Containers {
		if contains(ctr.Env, env.Name) {
			log.Debugf("Ignoring container '%s' in pod %s: env var '%s' already exist", ctr.Name, podStr, env.Name)
			continue
		}
		pod.Spec.Containers[i].Env = append(pod.Spec.Containers[i].Env, env)
		injected = true
	}
	return injected
}
func injectEnv ( pod * corev1 . Pod , env corev1 . EnvVar ) bool { injected := false podStr := podString ( pod ) log . Debugf ( " " , env . Name , podStr ) for i , ctr := range pod . Spec . Containers { if contains ( ctr . Env , env . Name ) { log . Debugf ( " " , ctr . Name , podStr , env . Name ) continue } pod . Spec . Containers [ i ] . Env = append ( pod . Spec . Containers [ i ] . Env , env ) injected = true } return injected }
injectEnv injects an env var into a pod template if it doesn't exist
injectEnv injects an env var into a pod template if it doesn ' t exist