Created
February 28, 2021 05:35
-
-
Save making/f0f8360aff2ad15b447e667feb2f2e2f to your computer and use it in GitHub Desktop.
metadata.nameが”-abc”で終わるものだけ変更を適用したい
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: demo-abc | |
spec: {} | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: demo-xyz | |
spec: {} | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: foo-abc | |
spec: {} |
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") | |
#@ endswith_abc = lambda i,left,right: left["metadata"]["name"].endswith("-abc") | |
#@ deployment = overlay.subset({"kind": "Deployment"}) | |
#@overlay/match by=overlay.and_op(endswith_abc, deployment), expects="1+" | |
#@overlay/match-child-defaults missing_ok=True | |
--- | |
spec: | |
strategy: | |
type: Recreate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment