Explorar el Código

HPCC-25996 Add version meta label to pods when tagging/publishing charts

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman hace 4 años
padre
commit
c00b2c56c2

+ 6 - 0
cmake_modules/go_gold.sh

@@ -53,6 +53,12 @@ update_version_file release $HPCC_POINT $NEW_SEQUENCE
 if [ -e helm/hpcc/Chart.yaml ] ; then
   update_chart_file helm/hpcc/Chart.yaml release $HPCC_POINT $NEW_SEQUENCE
   doit "git add helm/hpcc/Chart.yaml"
+  for f in helm/hpcc/templates/* ; do
+    update_chart_file $f release $HPCC_POINT $NEW_SEQUENCE
+    if [ "$CHART_CHANGED" != "0" ] ; then
+      doit "git add $f"
+    fi
+  done
 fi
 
 HPCC_MATURITY=release

+ 13 - 0
cmake_modules/go_rc.sh

@@ -43,6 +43,13 @@ if [ "$HPCC_MATURITY" = "closedown" ] ; then
   update_version_file closedown $((NEW_POINT+1)) 0 $NEW_MINOR
   if [ -e helm/hpcc/Chart.yaml ] ; then
     update_chart_file helm/hpcc/Chart.yaml closedown $((NEW_POINT+1)) 0 $NEW_MINOR 
+    doit "git add helm/hpcc/Chart.yaml"
+    for f in helm/hpcc/templates/* ; do
+      update_chart_file $f closedown $((NEW_POINT+1)) 0 $NEW_MINOR 
+    if [ "$CHART_CHANGED" != "0" ] ; then
+        doit "git add $f"
+      fi
+    done
   fi
   doit "git add $VERSIONFILE"
   doit "git commit -s -m \"Split off $HPCC_MAJOR.$NEW_MINOR.$NEW_POINT\""
@@ -69,6 +76,12 @@ update_version_file rc $NEW_POINT $NEW_SEQUENCE $NEW_MINOR
 if [ -e helm/hpcc/Chart.yaml ] ; then
   update_chart_file helm/hpcc/Chart.yaml rc $NEW_POINT $NEW_SEQUENCE $NEW_MINOR 
   doit "git add helm/hpcc/Chart.yaml"
+  for f in helm/hpcc/templates/* ; do
+    update_chart_file $f rc $NEW_POINT $NEW_SEQUENCE $NEW_MINOR 
+    if [ "$CHART_CHANGED" != "0" ] ; then
+      doit "git add $f"
+    fi
+  done
 fi
 
 HPCC_MATURITY=rc

+ 7 - 2
cmake_modules/parse_hpcc_chart.sh

@@ -62,18 +62,23 @@ function update_chart_file()
       echo sed -E \
        -e "s/^version: .*$/version: $_v/" \
        -e "s/^appVersion: .*$/appVersion: $_v/" \
+       -e "s/helmVersion: .*$/helmVersion: $_v/" \
        -i.bak $_chart
     fi
     if [ -z "$DRYRUN" ] ; then 
       sed -E \
        -e "s/^version: .*$/version: $_v/" \
        -e "s/^appVersion: .*$/appVersion: $_v/" \
+       -e "s/helmVersion: .*$/helmVersion: $_v/" \
        -i.bak $_chart
-       cat $_chart
     else
       sed -E \
        -e "s/^version: .*$/version: $_v/" \
        -e "s/^appVersion: .*$/appVersion: $_v/" \
-       $_chart
+       -e "s/helmVersion: .*$/helmVersion: $_v/" \
+       $_chart > $_chart.bak
     fi
+    CHART_CHANGED=0
+    diff -y  --suppress-common-lines $_chart $_chart.bak || CHART_CHANGED=1
+    rm $_chart.bak
 }

+ 1 - 0
helm/hpcc/templates/dali.yaml

@@ -20,6 +20,7 @@ spec:
       labels:
         run: {{ $dali.name | quote }}
         app: dali
+        helmVersion: 8.2.0-closedown
     spec:
       {{- include "hpcc.placementsByPodTargetType" (dict "root" $ "pod" $dali.name "type" "dali") | indent 6 }}
       serviceAccountName: "hpcc-default"

+ 1 - 0
helm/hpcc/templates/dfuserver.yaml

@@ -32,6 +32,7 @@ spec:
       labels:
         run: {{ .name | quote }}
         accessDali: "yes"
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec:

+ 2 - 0
helm/hpcc/templates/eclagent.yaml

@@ -34,6 +34,7 @@ data:
           labels:
             accessDali: "yes"
             accessEsp: "yes"
+            helmVersion: 8.2.0-closedown
         spec:
           {{- include "hpcc.placementsByJobTargetType" (dict "root" .root "job" $appJobName "target" .me.name "type" "eclagent") | indent 10 }}
           serviceAccountName: "hpcc-default"
@@ -101,6 +102,7 @@ spec:
         run: {{ .name | quote }}
         accessDali: "yes"
         accessEsp: {{ .useChildProcesses | default false | ternary "yes" "no" | quote }}
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec:

+ 2 - 0
helm/hpcc/templates/eclccserver.yaml

@@ -33,6 +33,7 @@ data:
           labels:
             accessDali: "yes"
             accessEsp: "yes"
+            helmVersion: 8.2.0-closedown
         spec:
           {{- include "hpcc.placementsByJobTargetType" (dict "root" .root "job" $compileJobName "target" .me.name "type" "eclccserver") | indent 10 }}
           serviceAccountName: "hpcc-default"
@@ -101,6 +102,7 @@ spec:
         run: {{ .name | quote }}
         accessDali: "yes"
         accessEsp: {{ .useChildProcesses | default false | ternary "yes" "no" | quote }}
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec:

+ 1 - 0
helm/hpcc/templates/eclscheduler.yaml

@@ -41,6 +41,7 @@ spec:
         run: {{ .name | quote }}
         accessDali: "yes"
         accessEsp: "no"
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec:

+ 1 - 0
helm/hpcc/templates/esp.yaml

@@ -70,6 +70,7 @@ spec:
         run: {{ .name | quote }}
         accessDali: "yes"
         app: {{ $application }}
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec:

+ 2 - 0
helm/hpcc/templates/localroxie.yaml

@@ -44,6 +44,7 @@ spec:
         roxie-server: {{ $servername | quote }}
         accessDali: "yes"
         accessEsp: "yes"
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec:
@@ -105,6 +106,7 @@ metadata:
   name: {{ $service.name | quote }}
   labels:
     type: roxie-service
+    helmVersion: 8.2.0-closedown
 spec:
   ports:
   - port: {{ $service.port }}

+ 0 - 1
helm/hpcc/templates/network.yaml

@@ -132,4 +132,3 @@ spec:
     - podSelector:
         matchLabels:
           app: eclservices
-          

+ 4 - 0
helm/hpcc/templates/roxie.yaml

@@ -77,6 +77,7 @@ spec:
       labels:
         run: {{ $commonCtx.toponame | quote }}
         roxie-cluster: {{ $roxie.name | quote }}
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $topoconfigSHA }}
     spec:
@@ -119,6 +120,7 @@ metadata:
   name: {{ $service.name | quote }}
   labels:
     type: roxie-service
+    helmVersion: 8.2.0-closedown
 spec:
   ports:
   - port: {{ $service.port }}
@@ -193,6 +195,7 @@ spec:
         roxie-cluster: {{ $roxie.name | quote }}
         accessDali: "yes"
         accessEsp: "yes"
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec:
@@ -277,6 +280,7 @@ spec:
         roxie-cluster: {{ $roxie.name | quote }}
         accessDali: "yes"
         accessEsp: "yes"
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec:

+ 1 - 0
helm/hpcc/templates/sasha.yaml

@@ -23,6 +23,7 @@ spec:
       labels:
         run: {{ $serviceName | quote }}
         accessDali: {{ (has "dali" $sasha.access) | ternary "yes" "no" | quote }}
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec:

+ 5 - 0
helm/hpcc/templates/thor.yaml

@@ -55,6 +55,7 @@ data:
           labels:
             accessDali: "yes"
             accessEsp: "yes"
+            helmVersion: 8.2.0-closedown
         spec:
           {{- include "hpcc.placementsByJobTargetType" (dict "root" .root "job" $eclAgentJobName "target" .me.name "type" "thor") | indent 10 }}
           serviceAccountName: "hpcc-agent"
@@ -114,6 +115,7 @@ data:
             accessDali: "yes"
             accessEsp: "yes"
             job: "_HPCC_JOBNAME_"
+            helmVersion: 8.2.0-closedown
         spec:
           {{- include "hpcc.placementsByJobTargetType" (dict "root" .root "job" $thorManagerJobName "target" .me.name "type" "thor") | indent 10 }}
           serviceAccountName: hpcc-agent
@@ -172,6 +174,7 @@ data:
             app: thor
             accessEsp: "true"
             job: "_HPCC_JOBNAME_"
+            helmVersion: 8.2.0-closedown
         spec:
           {{- include "hpcc.placementsByJobTargetType" (dict "root" .root "job" $thorWorkerJobName "target" .me.name "type" "thor") | indent 10 }}
           serviceAccountName: hpcc-default
@@ -266,6 +269,7 @@ spec:
         run: {{ $commonCtx.eclAgentName | quote }}
         accessDali: "yes"
         accessEsp: {{ $commonCtx.eclAgentUseChildProcesses | ternary "yes" "no" | quote }}
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec:
@@ -319,6 +323,7 @@ spec:
         run: {{ $commonCtx.thorAgentName | quote }}
         accessDali: "yes"
         accessEsp: "no"
+        helmVersion: 8.2.0-closedown
       annotations:
         checksum/config: {{ $configSHA }}
     spec: