Last active
August 14, 2019 11:27
-
-
Save ashi009/940bcdab2c6e9d3a4858e62e7df3f53c to your computer and use it in GitHub Desktop.
Strip metadata from k8s resources json (as a workaround for https://github.com/kubernetes/kubernetes/issues/24855)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
jq ' | |
del(.items[]?.status) | | |
del(.items[]?.metadata.annotations."kubectl.kubernetes.io/last-applied-configuration") | | |
del(.items[]?.metadata.annotations."ingress.kubernetes.io/backends") | | |
del(.items[]?.metadata.annotations."ingress.kubernetes.io/https-forwarding-rule") | | |
del(.items[]?.metadata.annotations."ingress.kubernetes.io/https-target-proxy") | | |
del(.items[]?.metadata.annotations."ingress.kubernetes.io/url-map") | | |
del(.items[]?.metadata.creationTimestamp) | | |
del(.items[]?.metadata.generation) | | |
del(.items[]?.metadata.resourceVersion) | | |
del(.items[]?.metadata.selfLink) | | |
del(.items[]?.metadata.uid) | | |
del(.metadata.creationTimestamp) | | |
del(.metadata.generation) | | |
del(.metadata.resourceVersion) | | |
del(.metadata.selfLink) | | |
del(.metadata.uid) | |
' $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment