From 083dccfe9144602339edd6afaa2c4ad8f9921091 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Wed, 29 Jul 2020 15:15:24 -0700 Subject: [PATCH] Update hash result in tests --- api/internal/target/kusttarget_test.go | 4 ++-- api/krusty/baseandoverlaymedium_test.go | 10 ++++----- api/krusty/component_test.go | 18 ++++++++-------- api/krusty/configmaps_test.go | 16 +++++++------- api/krusty/disablenamesuffix_test.go | 4 ++-- api/krusty/generatormergeandreplace_test.go | 24 ++++++++++----------- api/krusty/generatoroptions_test.go | 4 ++-- api/krusty/multiplepatch_test.go | 22 +++++++++---------- api/krusty/namespacedgenerators_test.go | 10 ++++----- api/krusty/transformerplugin_test.go | 2 +- api/krusty/variableref_test.go | 4 ++-- examples/configGeneration.md | 10 ++++----- examples/zh/configGeneration.md | 10 ++++----- 13 files changed, 69 insertions(+), 69 deletions(-) diff --git a/api/internal/target/kusttarget_test.go b/api/internal/target/kusttarget_test.go index 4b3e6ac32..7bb3d0856 100644 --- a/api/internal/target/kusttarget_test.go +++ b/api/internal/target/kusttarget_test.go @@ -201,7 +201,7 @@ metadata: "apiVersion": "v1", "kind": "ConfigMap", "metadata": map[string]interface{}{ - "name": "foo-literalConfigMap-bar-8d2dkb8k24", + "name": "foo-literalConfigMap-bar-g5f6t456f5", "namespace": "ns1", "labels": map[string]interface{}{ "app": "nginx", @@ -220,7 +220,7 @@ metadata: "apiVersion": "v1", "kind": "Secret", "metadata": map[string]interface{}{ - "name": "foo-secret-bar-9btc7bt4kb", + "name": "foo-secret-bar-82c2g5f8f6", "namespace": "ns1", "labels": map[string]interface{}{ "app": "nginx", diff --git a/api/krusty/baseandoverlaymedium_test.go b/api/krusty/baseandoverlaymedium_test.go index 19bb6fe7a..89eb108e9 100644 --- a/api/krusty/baseandoverlaymedium_test.go +++ b/api/krusty/baseandoverlaymedium_test.go @@ -231,7 +231,7 @@ spec: valueFrom: configMapKeyRef: key: somekey - name: test-infra-app-env-ffmd9b969m + name: test-infra-app-env-8h5mh7f7ch image: nginx:1.8.0 name: nginx ports: @@ -240,7 +240,7 @@ spec: - configMapRef: name: someConfigMap - configMapRef: - name: test-infra-app-env-ffmd9b969m + name: test-infra-app-env-8h5mh7f7ch image: busybox name: busybox volumeMounts: @@ -248,7 +248,7 @@ spec: name: app-env volumes: - configMap: - name: test-infra-app-env-ffmd9b969m + name: test-infra-app-env-8h5mh7f7ch name: app-env --- apiVersion: v1 @@ -288,7 +288,7 @@ metadata: app: mungebot org: kubernetes repo: test-infra - name: test-infra-app-env-ffmd9b969m + name: test-infra-app-env-8h5mh7f7ch --- apiVersion: v1 data: @@ -301,6 +301,6 @@ metadata: app: mungebot org: kubernetes repo: test-infra - name: test-infra-app-config-f462h769f9 + name: test-infra-app-config-49d6f5h7b5 `) } diff --git a/api/krusty/component_test.go b/api/krusty/component_test.go index bad059172..778e42289 100644 --- a/api/krusty/component_test.go +++ b/api/krusty/component_test.go @@ -132,7 +132,7 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: comp-my-configmap-ct5bgtbccd + name: comp-my-configmap-kc6k2kmkh9 --- apiVersion: v1 kind: Deployment @@ -186,7 +186,7 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: comp-my-configmap-dgf97tmg6h + name: comp-my-configmap-55249mf5kb --- apiVersion: v1 kind: Deployment @@ -241,7 +241,7 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: comp-my-configmap-dgf97tmg6h + name: comp-my-configmap-55249mf5kb --- apiVersion: v1 kind: Deployment @@ -283,7 +283,7 @@ data: testValue: "1" kind: ConfigMap metadata: - name: my-configmap-7k9t4h74f8 + name: my-configmap-2g9c94mhb8 --- apiVersion: v1 kind: Deployment @@ -301,7 +301,7 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: comp-my-configmap-ct5bgtbccd + name: comp-my-configmap-kc6k2kmkh9 --- apiVersion: v1 kind: Deployment @@ -349,7 +349,7 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: my-configmap-96dt22k28h + name: my-configmap-kc6k2kmkh9 `, }, "missing-optional-component-api-version": { @@ -380,7 +380,7 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: my-configmap-72cfg2mg5d + name: my-configmap-5g7gh5mgt5 --- apiVersion: v1 kind: Deployment @@ -427,7 +427,7 @@ data: testValue: "1" kind: ConfigMap metadata: - name: my-configmap-a-b-tfb7c5t69m + name: my-configmap-a-b-2g9c94mhb8 --- apiVersion: v1 kind: Deployment @@ -442,7 +442,7 @@ data: testValue: "1" kind: ConfigMap metadata: - name: my-configmap-b-8h7b8862bb + name: my-configmap-b-2g9c94mhb8 `, }, diff --git a/api/krusty/configmaps_test.go b/api/krusty/configmaps_test.go index 4563ac59d..a174ce3ec 100644 --- a/api/krusty/configmaps_test.go +++ b/api/krusty/configmaps_test.go @@ -81,7 +81,7 @@ data: vegetable: broccoli kind: ConfigMap metadata: - name: blah-bob-k772g5db55 + name: blah-bob-d87t8m8tgm --- apiVersion: v1 data: @@ -89,7 +89,7 @@ data: v2: '[{"path": "var/druid/segment-cache"}]' kind: ConfigMap metadata: - name: blah-json-9gtcc2fgb4 + name: blah-json-5298bc8g99 --- apiVersion: v1 data: @@ -101,7 +101,7 @@ data: vegetable: YnJvY2NvbGk= kind: Secret metadata: - name: blah-bob-gmc2824f4b + name: blah-bob-ftht6hfgmb type: Opaque `) } @@ -155,7 +155,7 @@ data: vegetable: broccoli kind: ConfigMap metadata: - name: blah-bob-gfkcbk5ckf + name: blah-bob-db529cg5bk `) } @@ -217,7 +217,7 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: p1-com1-dhbbm922gd + name: p1-com1-8tc62428t2 --- apiVersion: v1 data: @@ -226,7 +226,7 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: p2-com2-c4b8md75k9 + name: p2-com2-87mcggf7d7 `) } @@ -274,7 +274,7 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: o1-cm-28g596k77k + name: o1-cm-ft9mmdc8c6 --- apiVersion: v1 data: @@ -284,6 +284,6 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: cm-o2-gfcc59fg5m + name: cm-o2-5k95kd76ft `) } diff --git a/api/krusty/disablenamesuffix_test.go b/api/krusty/disablenamesuffix_test.go index de1753e0d..9580a8914 100644 --- a/api/krusty/disablenamesuffix_test.go +++ b/api/krusty/disablenamesuffix_test.go @@ -83,7 +83,7 @@ metadata: if secret == nil { t.Errorf("Expected to find a Secret") } - if secret.GetName() != "foo-secret-bar-9btc7bt4kb" { + if secret.GetName() != "foo-secret-bar-82c2g5f8f6" { t.Errorf("unexpected secret resource name: %s", secret.GetName()) } @@ -140,7 +140,7 @@ secretGenerator: if secret == nil { t.Errorf("Expected to find a Secret") } - if secret.GetName() != "yeshash-mcgcmdcm69" { + if secret.GetName() != "yeshash-82c2g5f8f6" { t.Errorf("unexpected secret resource name: %s", secret.GetName()) } } diff --git a/api/krusty/generatormergeandreplace_test.go b/api/krusty/generatormergeandreplace_test.go index fa0ac9631..6a8d4a82a 100644 --- a/api/krusty/generatormergeandreplace_test.go +++ b/api/krusty/generatormergeandreplace_test.go @@ -251,7 +251,7 @@ spec: - emptyDir: {} name: nginx-persistent-storage - configMap: - name: team-foo-configmap-in-base-bbdmdh7m8t + name: team-foo-configmap-in-base-798k5k7g9f name: configmap-in-base --- apiVersion: v1 @@ -283,7 +283,7 @@ metadata: app: mynginx org: example.com team: foo - name: team-foo-configmap-in-base-bbdmdh7m8t + name: team-foo-configmap-in-base-798k5k7g9f --- apiVersion: v1 data: @@ -297,7 +297,7 @@ metadata: app: mynginx org: example.com team: foo - name: team-foo-secret-in-base-tkm7hhtf8d + name: team-foo-secret-in-base-bgd6bkgdm2 type: Opaque `) } @@ -386,10 +386,10 @@ spec: pdName: nginx-persistent-storage name: nginx-persistent-storage - configMap: - name: staging-team-foo-configmap-in-base-gh9d7t85gb + name: staging-team-foo-configmap-in-base-hc6g9dk6g9 name: configmap-in-base - configMap: - name: staging-configmap-in-overlay-k7cbc75tg8 + name: staging-configmap-in-overlay-dc6fm46dhm name: configmap-in-overlay --- apiVersion: v1 @@ -424,7 +424,7 @@ metadata: env: staging org: example.com team: override-foo - name: staging-team-foo-configmap-in-base-gh9d7t85gb + name: staging-team-foo-configmap-in-base-hc6g9dk6g9 --- apiVersion: v1 data: @@ -440,7 +440,7 @@ metadata: env: staging org: example.com team: override-foo - name: staging-team-foo-secret-in-base-c8db7gk2m2 + name: staging-team-foo-secret-in-base-k2k4692t9g type: Opaque --- apiVersion: v1 @@ -451,7 +451,7 @@ metadata: labels: env: staging team: override-foo - name: staging-configmap-in-overlay-k7cbc75tg8 + name: staging-configmap-in-overlay-dc6fm46dhm `) } @@ -486,7 +486,7 @@ data: key: value kind: ConfigMap metadata: - name: test-t5t4md8fdm + name: test-t757gk2bmf namespace: default --- apiVersion: v1 @@ -494,7 +494,7 @@ data: key: value kind: ConfigMap metadata: - name: test-t5t4md8fdm + name: test-t757gk2bmf namespace: kube-system --- apiVersion: v1 @@ -503,7 +503,7 @@ data: username: YWRtaW4= kind: Secret metadata: - name: test-h65t9hg6kc + name: test-bgd6bkgdm2 namespace: default type: Opaque --- @@ -513,7 +513,7 @@ data: username: YWRtaW4= kind: Secret metadata: - name: test-h65t9hg6kc + name: test-bgd6bkgdm2 namespace: kube-system type: Opaque `) diff --git a/api/krusty/generatoroptions_test.go b/api/krusty/generatoroptions_test.go index aa2566347..5592b7a84 100644 --- a/api/krusty/generatoroptions_test.go +++ b/api/krusty/generatoroptions_test.go @@ -40,7 +40,7 @@ data: passphrase: ZGF0IHBocmFzZQ== kind: Secret metadata: - name: bob-kf5c9fccbt + name: bob-bh645k7tmg type: Opaque `) } @@ -91,6 +91,6 @@ kind: ConfigMap metadata: labels: fruit: apple - name: shouldHaveHash-2k9hc848ff + name: shouldHaveHash-c9867f8446 `) } diff --git a/api/krusty/multiplepatch_test.go b/api/krusty/multiplepatch_test.go index 8f80fcd19..e130b28b3 100644 --- a/api/krusty/multiplepatch_test.go +++ b/api/krusty/multiplepatch_test.go @@ -147,10 +147,10 @@ spec: pdName: nginx-persistent-storage name: nginx-persistent-storage - configMap: - name: a-b-configmap-in-base-fm96mhk4dt + name: a-b-configmap-in-base-798k5k7g9f name: configmap-in-base - configMap: - name: a-configmap-in-overlay-ffm9hf78mc + name: a-configmap-in-overlay-dc6fm46dhm name: configmap-in-overlay --- apiVersion: v1 @@ -175,7 +175,7 @@ metadata: labels: env: staging team: foo - name: a-b-configmap-in-base-fm96mhk4dt + name: a-b-configmap-in-base-798k5k7g9f --- apiVersion: v1 data: @@ -184,7 +184,7 @@ kind: ConfigMap metadata: labels: env: staging - name: a-configmap-in-overlay-ffm9hf78mc + name: a-configmap-in-overlay-dc6fm46dhm `) } @@ -352,10 +352,10 @@ spec: pdName: nginx-persistent-storage name: nginx-persistent-storage - configMap: - name: staging-team-foo-configmap-in-base-g7k6gt2889 + name: staging-team-foo-configmap-in-base-798k5k7g9f name: configmap-in-base - configMap: - name: staging-configmap-in-overlay-k7cbc75tg8 + name: staging-configmap-in-overlay-dc6fm46dhm name: configmap-in-overlay --- apiVersion: v1 @@ -390,7 +390,7 @@ metadata: env: staging org: example.com team: foo - name: staging-team-foo-configmap-in-base-g7k6gt2889 + name: staging-team-foo-configmap-in-base-798k5k7g9f --- apiVersion: v1 data: @@ -399,7 +399,7 @@ kind: ConfigMap metadata: labels: env: staging - name: staging-configmap-in-overlay-k7cbc75tg8 + name: staging-configmap-in-overlay-dc6fm46dhm `) } @@ -542,7 +542,7 @@ spec: volumes: - name: nginx-persistent-storage - configMap: - name: staging-team-foo-configmap-in-base-g7k6gt2889 + name: staging-team-foo-configmap-in-base-798k5k7g9f name: configmap-in-base --- apiVersion: v1 @@ -577,7 +577,7 @@ metadata: env: staging org: example.com team: foo - name: staging-team-foo-configmap-in-base-g7k6gt2889 + name: staging-team-foo-configmap-in-base-798k5k7g9f --- apiVersion: v1 data: @@ -586,7 +586,7 @@ kind: ConfigMap metadata: labels: env: staging - name: staging-configmap-in-overlay-k7cbc75tg8 + name: staging-configmap-in-overlay-dc6fm46dhm `) }) } diff --git a/api/krusty/namespacedgenerators_test.go b/api/krusty/namespacedgenerators_test.go index b6349fa1e..3c1d408fd 100644 --- a/api/krusty/namespacedgenerators_test.go +++ b/api/krusty/namespacedgenerators_test.go @@ -42,7 +42,7 @@ data: enableRisky: "false" kind: ConfigMap metadata: - name: the-non-default-namespace-map-b6h49k7mt8 + name: the-non-default-namespace-map-64b2md8tth namespace: non-default --- apiVersion: v1 @@ -51,14 +51,14 @@ data: enableRisky: "false" kind: ConfigMap metadata: - name: the-map-4959m5tm6c + name: the-map-tg7t5hk8bk --- apiVersion: v1 data: password.txt: dmVyeVNlY3JldA== kind: Secret metadata: - name: the-non-default-namespace-secret-h8d9hkgtb9 + name: the-non-default-namespace-secret-8tc9gdd76t namespace: non-default type: Opaque --- @@ -67,7 +67,7 @@ data: password.txt: YW5vdGhlclNlY3JldA== kind: Secret metadata: - name: the-secret-fgb45h45bh + name: the-secret-6557m7fcg8 type: Opaque `) } @@ -104,7 +104,7 @@ kind: ConfigMap metadata: annotations: {} labels: {} - name: testCase-4g75kbk6gm + name: testCase-bcbmmg48hd namespace: overlay `) } diff --git a/api/krusty/transformerplugin_test.go b/api/krusty/transformerplugin_test.go index 279900f81..110baaabd 100644 --- a/api/krusty/transformerplugin_test.go +++ b/api/krusty/transformerplugin_test.go @@ -96,7 +96,7 @@ data: FOO: foo kind: ConfigMap metadata: - name: test-k4bkhftttd + name: test-6bc28fff49 `) } diff --git a/api/krusty/variableref_test.go b/api/krusty/variableref_test.go index 663ac9bc3..ea246106f 100644 --- a/api/krusty/variableref_test.go +++ b/api/krusty/variableref_test.go @@ -895,7 +895,7 @@ spec: - command: - echo - dev-base-cockroachdb - - dev-base-test-config-map-b2g2dmd64b + - dev-base-test-config-map-6b85g79g7g env: - name: CDB_PUBLIC_SVC value: dev-base-cockroachdb-public @@ -921,7 +921,7 @@ data: foo: bar kind: ConfigMap metadata: - name: dev-base-test-config-map-b2g2dmd64b + name: dev-base-test-config-map-6b85g79g7g `) } diff --git a/examples/configGeneration.md b/examples/configGeneration.md index 8ba53ce17..384872109 100644 --- a/examples/configGeneration.md +++ b/examples/configGeneration.md @@ -159,11 +159,11 @@ The configMap name is suffixed by _-v1_, per the The suffix to the configMap name is generated from a hash of the maps content - in this case the name suffix -is _k25m8k5k5m_: +is _5276h4th55_: ``` -kustomize build $OVERLAYS/staging | grep k25m8k5k5m +kustomize build $OVERLAYS/staging | grep 5276h4th55 ``` Now modify the map patch, to change the greeting @@ -190,20 +190,20 @@ kustomize build $OVERLAYS/staging |\ ``` Confirm that the change in configMap content resulted -in three new names ending in _cd7kdh48fd_ - one in the +in three new names ending in _c2g8fcbf88_ - one in the configMap name itself, and two in the deployment that uses the map: ``` test 3 == \ - $(kustomize build $OVERLAYS/staging | grep cd7kdh48fd | wc -l); \ + $(kustomize build $OVERLAYS/staging | grep c2g8fcbf88 | wc -l); \ echo $? ``` Applying these resources to the cluster will result in a rolling update of the deployments pods, retargetting -them from the _k25m8k5k5m_ maps to the _cd7kdh48fd_ +them from the _5276h4th55_ maps to the _c2g8fcbf88_ maps. The system will later garbage collect the unused maps. diff --git a/examples/zh/configGeneration.md b/examples/zh/configGeneration.md index 4a02b15fc..73c4cb394 100644 --- a/examples/zh/configGeneration.md +++ b/examples/zh/configGeneration.md @@ -139,11 +139,11 @@ kustomize build $OVERLAYS/staging |\ 根据 `$OVERLAYS/staging/kustomization.yaml` 中的 `nameSuffix` 字段,configMap 名称以 _-v1_ 为后缀。 -configMap 名称的后缀是由 map 内容的哈希生成的 - 在这种情况下,名称后缀是 _k25m8k5k5m_ : +configMap 名称的后缀是由 map 内容的哈希生成的 - 在这种情况下,名称后缀是 _5276h4th55_ : ``` -kustomize build $OVERLAYS/staging | grep k25m8k5k5m +kustomize build $OVERLAYS/staging | grep 5276h4th55 ``` 现在修改 map patch ,更改该服务将使用的问候消息: @@ -168,16 +168,16 @@ kustomize build $OVERLAYS/staging |\ grep -B 8 -A 1 staging-the-map ``` -确认 configMap 内容的更改将会生成以 _cd7kdh48fd_ 结尾的三个新名称 - 一个在 configMap 的名称中,另两个在使用 ConfigMap 的 deployment 中: +确认 configMap 内容的更改将会生成以 _c2g8fcbf88_ 结尾的三个新名称 - 一个在 configMap 的名称中,另两个在使用 ConfigMap 的 deployment 中: ``` test 3 == \ - $(kustomize build $OVERLAYS/staging | grep cd7kdh48fd | wc -l); \ + $(kustomize build $OVERLAYS/staging | grep c2g8fcbf88 | wc -l); \ echo $? ``` -将这些资源应用于群集将导致 deployment pod 的滚动更新,将它们从 _k25m8k5k5m_ map 重新定位到 _cd7kdh48fd_ map 。系统稍后将垃圾收集未使用的 map。 +将这些资源应用于群集将导致 deployment pod 的滚动更新,将它们从 _5276h4th55_ map 重新定位到 _c2g8fcbf88_ map 。系统稍后将垃圾收集未使用的 map。 ## 回滚