micnncim / kubectl-reap

kubectl plugin that deletes unused Kubernetes resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConfigMaps in CronJobs Env are not detected as in use

robertkaelin opened this issue · comments

(Similiar to #120)

I've found that ConfigMaps used by CronJobs for eg. env vars are not detected as in-use.

apiVersion: batch/v1
kind: CronJob
metadata:
  name: test
spec:
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - env:
                - name: TEST
                  valueFrom:
                    configMapKeyRef:
                      key: TEST
                      name: test-config

Output from kubectl reap cm:

configmap/test-config deleted