mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 17:41:13 +00:00
Test examples against HEAD as well as against latest release.
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
|
||||
Define a place to work:
|
||||
|
||||
<!-- @makeWorkplace @test -->
|
||||
<!-- @makeWorkplace @testAgainstLatestRelease -->
|
||||
```
|
||||
DEMO_HOME=$(mktemp -d)
|
||||
```
|
||||
|
||||
Make a `kustomization` containing a pod resource
|
||||
|
||||
<!-- @createKustomization @test -->
|
||||
<!-- @createKustomization @testAgainstLatestRelease -->
|
||||
```
|
||||
cat <<EOF >$DEMO_HOME/kustomization.yaml
|
||||
resources:
|
||||
@@ -20,7 +20,7 @@ EOF
|
||||
|
||||
Declare the pod resource
|
||||
|
||||
<!-- @createDeployment @test -->
|
||||
<!-- @createDeployment @testAgainstLatestRelease -->
|
||||
```
|
||||
cat <<EOF >$DEMO_HOME/pod.yaml
|
||||
apiVersion: v1
|
||||
@@ -46,7 +46,7 @@ The image `busybox` and tag `1.29.0` can be changed by adding `images` in `kusto
|
||||
|
||||
|
||||
Add `images`:
|
||||
<!-- @addImages @test -->
|
||||
<!-- @addImages @testAgainstLatestRelease -->
|
||||
```
|
||||
cd $DEMO_HOME
|
||||
kustomize edit set image busybox=alpine:3.6
|
||||
@@ -61,14 +61,14 @@ The following `images` will be added to `kustomization.yaml`:
|
||||
> ```
|
||||
|
||||
Now build this `kustomization`
|
||||
<!-- @kustomizeBuild @test -->
|
||||
<!-- @kustomizeBuild @testAgainstLatestRelease -->
|
||||
```
|
||||
kustomize build $DEMO_HOME
|
||||
```
|
||||
|
||||
Confirm that this replaces _both_ busybox images and tags for `alpine:3.6`:
|
||||
|
||||
<!-- @confirmImages @test -->
|
||||
<!-- @confirmImages @testAgainstLatestRelease -->
|
||||
```
|
||||
test 2 = \
|
||||
$(kustomize build $DEMO_HOME | grep alpine:3.6 | wc -l); \
|
||||
|
||||
Reference in New Issue
Block a user