digitalocean / clusterlint

A best practices checker for Kubernetes clusters. 🤠
Apache License 2.0
542 stars 45 forks source link

Unused Confimap Check does not consider configMapKeyRef for pod env vars #78

Closed cherma22 closed 4 years ago

cherma22 commented 4 years ago

Looking at the function that checks for env vars in a pod that correspond to a ConfigMap, this considers ConfigMapRef, but not configMapKeyRef. The latter per the docs is also a valid usage of a ConfigMap.

  1. I am running the latest release of clusterlint to do some checking.
  2. I would expect to see no warnings for unused ConfigMaps, as these are consumed with configMapKeyRef
  3. I am getting warnings for unused ConfigMaps, that are clearly being used by configMapKeyRef when the yaml is reviewed.
adamwg commented 4 years ago

Thanks for reporting this! Agreed, this is an oversight - we should fix the check to also consider configMapKeyRef.