Last active
February 22, 2022 17:39
-
-
Save pivotaljohn/403b9f3cee251654e95761f75b628fda to your computer and use it in GitHub Desktop.
matching on map items, regardless of key name
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
| kind: Foo | |
| spec: | |
| github: | |
| event1: | |
| apple: 1 | |
| event2: | |
| banana: 2 | |
| event3: | |
| cherry: 3 | |
| --- | |
| kind: Foo | |
| spec: | |
| gitlab: | |
| event1: | |
| flip: true | |
| event2: | |
| flap: true | |
| event3: | |
| flop: true | |
| --- | |
| kind: Foo | |
| spec: | |
| github: | |
| event4: | |
| apple: 4 | |
| event5: | |
| banana: 5 | |
| event6: | |
| cherry: 6 | |
| --- | |
| kind: Bar | |
| spec: | |
| github: | |
| event7: 7 | |
| event8: 8 | |
| event9: 9 |
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
| #@ load("@ytt:overlay", "overlay") | |
| #@overlay/match by=overlay.subset({"kind": "Foo"}), expects="1+" | |
| --- | |
| kind: Foo | |
| spec: | |
| #@overlay/match when=1 | |
| github: | |
| #@overlay/match by=overlay.all, expects="1+" | |
| _: | |
| #@overlay/match missing_ok=True | |
| owner: "new-owner" | |
| #@overlay/match missing_ok=True | |
| webhook: | |
| url: https://localost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment