You can use ConfigMaps as values for container environment variables. This validator detects when a ConfigMap used as a source for environment variables is empty. Because of that, no environment variables will be sources from the ConfigMap.
Affected Resources: Deployment, DaemonSet, StatefulSet, CronJob, Job, ReplicaSet, Pod
kind: Deployment
spec:
template:
spec:
containers:
- name: my-container
envFrom:
- configMapRef:
name: my-config-map # This ConfigMap is empty
kind: ConfigMap
metadata:
name: my-config-map
data: {} # Empty data or no data at all
kind: ConfigMap
metadata:
name: my-config-map
data:
ENV_FOO: bar
$ kubectl delete configmap my-config-map -n
Please let us know if there are other built-in validation rules you would like to see in Kubevious to detect misconfigurations and violations to best practices. Optionally, you can provide your details so we can reach out to you with follow-up questions.