Skip to content

Instantly share code, notes, and snippets.

@pivotaljohn
Last active February 22, 2022 17:39
Show Gist options
  • Select an option

  • Save pivotaljohn/403b9f3cee251654e95761f75b628fda to your computer and use it in GitHub Desktop.

Select an option

Save pivotaljohn/403b9f3cee251654e95761f75b628fda to your computer and use it in GitHub Desktop.
matching on map items, regardless of key name
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
#@ 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