itaysk / kubectl-neat

Clean up Kubernetes yaml and json output to make it readable
Apache License 2.0
1.68k stars 100 forks source link

Neat fails to remove `creationTimestamp: null` in deployment pod template (and maybe other templates) #64

Open spkane opened 3 years ago

spkane commented 3 years ago

kubectl create deployment test --image=test --namespace test --dry-run=client -o yaml --replicas=3 | kubectl neat

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: test
  name: test
  namespace: test
spec:
  replicas: 3
  selector:
    matchLabels:
      app: test
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: test
    spec:
      containers:
      - image: test
        name: test
itaysk commented 3 years ago

Hi @spkane thanks for reporting. yes currently kubectl-neat only cleans the proper metadata at the top level, it doesn't know about other metadata items that "hide" within the pod template. I'll leave this open in case someone wants to propose a solution