mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Merge pull request #451 from richardmarshall/kustomize-add-patch-command
Add subcommand for adding patches to the kustomization file
This commit is contained in:
@@ -111,10 +111,7 @@ spec:
|
|||||||
value: prod
|
value: prod
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF >>$DEMO_HOME/kustomization.yaml
|
kustomize edit add patch patch.yaml
|
||||||
patches:
|
|
||||||
- patch.yaml
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF >$DEMO_HOME/application-prod.properties
|
cat <<EOF >$DEMO_HOME/application-prod.properties
|
||||||
spring.jpa.hibernate.ddl-auto=update
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
@@ -304,16 +301,14 @@ include this patch.
|
|||||||
|
|
||||||
<!-- @addPatch @test -->
|
<!-- @addPatch @test -->
|
||||||
```
|
```
|
||||||
mv $DEMO_HOME/kustomization.yaml $DEMO_HOME/tmp.yaml
|
kustomize edit add patch memorylimit_patch.yaml
|
||||||
|
kustomize edit add patch healthcheck_patch.yaml
|
||||||
sed '/patches:$/{N;s/- patch.yaml/- patch.yaml\n- memorylimit_patch.yaml\n- healthcheck_patch.yaml/}' \
|
|
||||||
$DEMO_HOME/tmp.yaml >& $DEMO_HOME/kustomization.yaml
|
|
||||||
```
|
```
|
||||||
|
|
||||||
`kustomization.yaml` should have patches field:
|
`kustomization.yaml` should have patches field:
|
||||||
|
|
||||||
> ```
|
> ```
|
||||||
> patches
|
> patches:
|
||||||
> - patch.yaml
|
> - patch.yaml
|
||||||
> - memorylimit_patch.yaml
|
> - memorylimit_patch.yaml
|
||||||
> - healthcheck_patch.yaml
|
> - healthcheck_patch.yaml
|
||||||
|
|||||||
Reference in New Issue
Block a user