Last active
April 19, 2023 14:21
-
-
Save pivotaljohn/9b18f45765efc0b6d5460a4b2c6bfdd7 to your computer and use it in GitHub Desktop.
This file contains 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
kind: Widget | |
metadata: | |
name: foo-with-more-than-all-labels | |
labels: | |
label0: value0 | |
label1: value1 | |
label2: value2 | |
label3: value3 | |
label4: value4 | |
--- | |
kind: Widget | |
metadata: | |
name: foo-with-all-labels | |
labels: | |
label1: value1 | |
label2: value2 | |
label3: value3 | |
--- | |
kind: Widget | |
metadata: | |
name: foo-with-some-labels | |
labels: | |
label2: value2 | |
label3: value3 | |
--- | |
kind: Widget | |
metadata: | |
name: foo-with-none-of-labels | |
labels: | |
labelX: valueX | |
labelY: valueY | |
--- | |
kind: Widget | |
metadata: | |
name: foo-without-labels |
This file contains 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
#@ load("@ytt:overlay", "overlay") | |
#@overlay/match by=overlay.all, expects="1+" | |
--- | |
#@overlay/match-child-defaults when=1 | |
metadata: | |
labels: | |
#@overlay/remove | |
label1: | |
#@overlay/remove | |
label2: | |
#@overlay/remove | |
label3: | |
#! If "labels" is now empty, remove it entirely | |
#@overlay/match by=overlay.all, expects="1+" | |
--- | |
metadata: | |
#@overlay/match by=lambda _, left, __: len(left) == 0, when=1 | |
#@overlay/remove | |
labels: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment