From ab8c81f2ee0953e4e2ead0817e471ff0c1f65f79 Mon Sep 17 00:00:00 2001 From: "Anderson, Craig (ca846m)" Date: Fri, 19 Jul 2019 18:12:23 -0700 Subject: [PATCH] Restore overrides functionality after regression Revert 833d426da8e4b049277ca9847830f6e6beee40c3 https://review.opendev.org/#/c/667022 introduced a regression in the overrides functionality, which caused the corresponding gate test to fail. This "fixed" a problem by breaking the override capability. This patchset reverts the previous to restore override functionality and make gates green again. Deep copy is added in order to resolve the original problem that 667022 attempted to resolve. Change-Id: I6c052c0fabe0067612d6a3d9d3bfac4df59202d7 --- .../templates/utils/_osd_daemonset_overrides.tpl | 14 ++++++++------ .../templates/utils/_daemonset_overrides.tpl | 14 ++++++++------ tools/gate/divingbell/divingbell-tests.sh | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/ceph-osd/templates/utils/_osd_daemonset_overrides.tpl b/ceph-osd/templates/utils/_osd_daemonset_overrides.tpl index 7947695db..eae93b72a 100644 --- a/ceph-osd/templates/utils/_osd_daemonset_overrides.tpl +++ b/ceph-osd/templates/utils/_osd_daemonset_overrides.tpl @@ -53,10 +53,11 @@ limitations under the License. {{/* apply overrides */}} {{- $override_conf_copy := $host_data.conf }} - {{- $root_conf_copy := omit $context.Values.conf "overrides" }} - {{- $merged_dict := merge $override_conf_copy $root_conf_copy }} + {{/* Deep copy to prevent https://storyboard.openstack.org/#!/story/2005936 */}} + {{- $root_conf_copy := omit ($context.Values.conf | toYaml | fromYaml) "overrides" }} + {{- $merged_dict := mergeOverwrite $root_conf_copy $override_conf_copy }} {{- $root_conf_copy2 := dict "conf" $merged_dict }} - {{- $context_values := omit $context.Values "conf" }} + {{- $context_values := omit (omit ($context.Values | toYaml | fromYaml) "conf") "__daemonset_list" }} {{- $root_conf_copy3 := mergeOverwrite $context_values $root_conf_copy2 }} {{- $root_conf_copy4 := dict "Values" $root_conf_copy3 }} {{- $_ := set $current_dict "nodeData" $root_conf_copy4 }} @@ -92,10 +93,11 @@ limitations under the License. {{/* apply overrides */}} {{- $override_conf_copy := $label_data.conf }} - {{- $root_conf_copy := omit $context.Values.conf "overrides" }} - {{- $merged_dict := merge $override_conf_copy $root_conf_copy }} + {{/* Deep copy to prevent https://storyboard.openstack.org/#!/story/2005936 */}} + {{- $root_conf_copy := omit ($context.Values.conf | toYaml | fromYaml) "overrides" }} + {{- $merged_dict := mergeOverwrite $root_conf_copy $override_conf_copy }} {{- $root_conf_copy2 := dict "conf" $merged_dict }} - {{- $context_values := omit $context.Values "conf" }} + {{- $context_values := omit (omit ($context.Values | toYaml | fromYaml) "conf") "__daemonset_list" }} {{- $root_conf_copy3 := mergeOverwrite $context_values $root_conf_copy2 }} {{- $root_conf_copy4 := dict "Values" $root_conf_copy3 }} {{- $_ := set $context.Values.__current_label "nodeData" $root_conf_copy4 }} diff --git a/helm-toolkit/templates/utils/_daemonset_overrides.tpl b/helm-toolkit/templates/utils/_daemonset_overrides.tpl index 50e43cacf..e352bc9a2 100644 --- a/helm-toolkit/templates/utils/_daemonset_overrides.tpl +++ b/helm-toolkit/templates/utils/_daemonset_overrides.tpl @@ -47,10 +47,11 @@ limitations under the License. {{/* apply overrides */}} {{- $override_conf_copy := $host_data.conf }} - {{- $root_conf_copy := omit $context.Values.conf "overrides" }} - {{- $merged_dict := merge $override_conf_copy $root_conf_copy }} + {{/* Deep copy to prevent https://storyboard.openstack.org/#!/story/2005936 */}} + {{- $root_conf_copy := omit ($context.Values.conf | toYaml | fromYaml) "overrides" }} + {{- $merged_dict := mergeOverwrite $root_conf_copy $override_conf_copy }} {{- $root_conf_copy2 := dict "conf" $merged_dict }} - {{- $context_values := omit $context.Values "conf" }} + {{- $context_values := omit (omit ($context.Values | toYaml | fromYaml) "conf") "__daemonset_list" }} {{- $root_conf_copy3 := mergeOverwrite $context_values $root_conf_copy2 }} {{- $root_conf_copy4 := dict "Values" $root_conf_copy3 }} {{- $_ := set $current_dict "nodeData" $root_conf_copy4 }} @@ -86,10 +87,11 @@ limitations under the License. {{/* apply overrides */}} {{- $override_conf_copy := $label_data.conf }} - {{- $root_conf_copy := omit $context.Values.conf "overrides" }} - {{- $merged_dict := merge $override_conf_copy $root_conf_copy }} + {{/* Deep copy to prevent https://storyboard.openstack.org/#!/story/2005936 */}} + {{- $root_conf_copy := omit ($context.Values.conf | toYaml | fromYaml) "overrides" }} + {{- $merged_dict := mergeOverwrite $root_conf_copy $override_conf_copy }} {{- $root_conf_copy2 := dict "conf" $merged_dict }} - {{- $context_values := omit $context.Values "conf" }} + {{- $context_values := omit (omit ($context.Values | toYaml | fromYaml) "conf") "__daemonset_list" }} {{- $root_conf_copy3 := mergeOverwrite $context_values $root_conf_copy2 }} {{- $root_conf_copy4 := dict "Values" $root_conf_copy3 }} {{- $_ := set $context.Values.__current_label "nodeData" $root_conf_copy4 }} diff --git a/tools/gate/divingbell/divingbell-tests.sh b/tools/gate/divingbell/divingbell-tests.sh index eae250715..e3b6fa52d 100755 --- a/tools/gate/divingbell/divingbell-tests.sh +++ b/tools/gate/divingbell/divingbell-tests.sh @@ -20,6 +20,6 @@ git clone https://opendev.org/airship/divingbell cd divingbell mkdir build ln -s ../openstack-helm-infra build/openstack-helm-infra -export HELM_ARTIFACT_URL=https://storage.googleapis.com/kubernetes-helm/helm-v2.13.0-linux-amd64.tar.gz +export HELM_ARTIFACT_URL=https://storage.googleapis.com/kubernetes-helm/helm-v2.14.1-linux-amd64.tar.gz ./tools/gate/scripts/010-build-charts.sh sudo SKIP_BASE_TESTS=true ./tools/gate/scripts/020-test-divingbell.sh