Skip to content

Instantly share code, notes, and snippets.

ORIGINAL_FILE=$1
echo cleaning $1
yq eval 'del(.metadata.annotations."kubectl.kubernetes.io/last-applied-configuration")' -i $ORIGINAL_FILE
yq eval 'del(.metadata.creationTimestamp)' -i $ORIGINAL_FILE
yq eval 'del(.metadata.generation)' -i $ORIGINAL_FILE
yq eval 'del(.metadata.managedFields)' -i $ORIGINAL_FILE
yq eval 'del(.metadata.ownerReferences)' -i $ORIGINAL_FILE
yq eval 'del(.metadata.resourceVersion)' -i $ORIGINAL_FILE