Created
August 14, 2019 09:57
-
-
Save ashi009/97ee544dcaf3ac2c4f4d4ab340e9efa7 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) | |
' $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment