Skip to content

How to remove an empty map from YAML? #882

Answered by andremicocci
andremicocci asked this question in Q&A
Discussion options

You must be logged in to vote

This example works!!!

yq e 'del(.metadata.annotations | select(length==0))' yaml

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@dalain007
Comment options

Answer selected by andremicocci
Comment options

You must be logged in to vote
1 reply
@flavono123
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants