From e6b52e7295bbc4d3c332fc044685d2c4929f0e35 Mon Sep 17 00:00:00 2001 From: minchao Date: Wed, 24 Mar 2021 11:19:53 +0800 Subject: [PATCH] Fix init command in wordpress example --- examples/wordpress/README.md | 19 ++++++++++--------- examples/wordpress/patch.yaml | 5 ++--- examples/zh/vars.md | 19 ++++++++++--------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/examples/wordpress/README.md b/examples/wordpress/README.md index cdbfcf5a0..16e7f2db2 100644 --- a/examples/wordpress/README.md +++ b/examples/wordpress/README.md @@ -86,9 +86,8 @@ The patch has following content > initContainers: > - name: init-command > image: debian -> command: -> - "echo $(WORDPRESS_SERVICE)" -> - "echo $(MYSQL_SERVICE)" +> command: ["/bin/sh"] +> args: ["-c", "echo $(WORDPRESS_SERVICE); echo $(MYSQL_SERVICE)"] > containers: > - name: wordpress > env: @@ -138,11 +137,13 @@ Expect this in the output: > ``` > (truncated) > ... -> initContainers: -> - command: -> - echo demo-wordpress -> - echo demo-mysql -> image: debian -> name: init-command +> initContainers: +> - args: +> - -c +> - echo demo-wordpress; echo demo-mysql +> command: +> - /bin/sh +> image: debian +> name: init-command > > ``` diff --git a/examples/wordpress/patch.yaml b/examples/wordpress/patch.yaml index ee606a96e..f00a95368 100644 --- a/examples/wordpress/patch.yaml +++ b/examples/wordpress/patch.yaml @@ -8,9 +8,8 @@ spec: initContainers: - name: init-command image: debian - command: - - "echo $(WORDPRESS_SERVICE)" - - "echo $(MYSQL_SERVICE)" + command: ["/bin/sh"] + args: ["-c", "echo $(WORDPRESS_SERVICE); echo $(MYSQL_SERVICE)"] containers: - name: wordpress env: diff --git a/examples/zh/vars.md b/examples/zh/vars.md index 173eb4135..e2fb207fa 100644 --- a/examples/zh/vars.md +++ b/examples/zh/vars.md @@ -86,9 +86,8 @@ curl -s -o "$DEMO_HOME/#1.yaml" \ > initContainers: > - name: init-command > image: debian -> command: -> - "echo $(WORDPRESS_SERVICE)" -> - "echo $(MYSQL_SERVICE)" +> command: ["/bin/sh"] +> args: ["-c", "echo $(WORDPRESS_SERVICE); echo $(MYSQL_SERVICE)"] > containers: > - name: wordpress > env: @@ -138,11 +137,13 @@ kustomize build $DEMO_HOME > ```yaml > (truncated) > ... -> initContainers: -> - command: -> - echo demo-wordpress -> - echo demo-mysql -> image: debian -> name: init-command +> initContainers: +> - args: +> - -c +> - echo demo-wordpress; echo demo-mysql +> command: +> - /bin/sh +> image: debian +> name: init-command > > ```