Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-flock / stx-openstack-armada-app / openstack-helm-infra / 0006-Fix-pod-restarts-on-all-workers-when-worker-added-re.patch
1 From 326fcd76f54d7c099f4c3da6c31eefe0eef2e236 Mon Sep 17 00:00:00 2001
2 From: Ovidiu Poncea <ovidiu.poncea@windriver.com>
3 Date: Mon, 29 Jul 2019 08:00:01 -0400
4 Subject: [PATCH] Fix pod restarts on all workers when worker added/removed
5
6 ---
7  helm-toolkit/templates/utils/_daemonset_overrides.tpl | 4 ++--
8  helm-toolkit/templates/utils/_hash.tpl                | 2 +-
9  2 files changed, 3 insertions(+), 3 deletions(-)
10
11 diff --git a/helm-toolkit/templates/utils/_daemonset_overrides.tpl b/helm-toolkit/templates/utils/_daemonset_overrides.tpl
12 index ab1177a..e564869 100644
13 --- a/helm-toolkit/templates/utils/_daemonset_overrides.tpl
14 +++ b/helm-toolkit/templates/utils/_daemonset_overrides.tpl
15 @@ -215,7 +215,7 @@ limitations under the License.
16      name uniqueness */}}
17      {{- $_ := set $current_dict "dns_1123_name" dict }}
18      {{- if hasKey $current_dict "matchExpressions" }}
19 -      {{- $_ := set $current_dict "dns_1123_name" (printf (print $name_format2 "-" ($current_dict.matchExpressions | quote | sha256sum | trunc 8))) }}
20 +      {{- $_ := set $current_dict "dns_1123_name" (printf (print $name_format2 "-" ($current_dict.matchExpressions | toJson | sha256sum | trunc 8))) }}
21      {{- else }}
22        {{- $_ := set $current_dict "dns_1123_name" $name_format2 }}
23      {{- end }}
24 @@ -258,7 +258,7 @@ limitations under the License.
25      {{- if not $context.Values.__daemonset_yaml.spec.template.metadata }}{{- $_ := set $context.Values.__daemonset_yaml.spec.template "metadata" dict }}{{- end }}
26      {{- if not $context.Values.__daemonset_yaml.spec.template.metadata.annotations }}{{- $_ := set $context.Values.__daemonset_yaml.spec.template.metadata "annotations" dict }}{{- end }}
27      {{- $cmap := list $current_dict.dns_1123_name $current_dict.nodeData | include $configmap_include }}
28 -    {{- $values_hash := $cmap | quote | sha256sum }}
29 +    {{- $values_hash := $cmap | toJson | sha256sum }}
30      {{- $_ := set $context.Values.__daemonset_yaml.spec.template.metadata.annotations "configmap-etc-hash" $values_hash }}
31  
32      {{/* generate configmap */}}
33 diff --git a/helm-toolkit/templates/utils/_hash.tpl b/helm-toolkit/templates/utils/_hash.tpl
34 index 1041ec0..e419e3b 100644
35 --- a/helm-toolkit/templates/utils/_hash.tpl
36 +++ b/helm-toolkit/templates/utils/_hash.tpl
37 @@ -19,5 +19,5 @@ limitations under the License.
38  {{- $context := index . 1 -}}
39  {{- $last := base $context.Template.Name }}
40  {{- $wtf := $context.Template.Name | replace $last $name -}}
41 -{{- include $wtf $context | sha256sum | quote -}}
42 +{{- include $wtf $context | toJson | sha256sum | quote -}}
43  {{- end -}}
44 -- 
45 2.7.4
46