[Tree-Wide] Reference ports by name not index 62/112362/2
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Wed, 9 Sep 2020 11:14:27 +0000 (13:14 +0200)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Fri, 11 Sep 2020 19:14:24 +0000 (19:14 +0000)
Referencing anything based on its position on alist can be really
fragile and har to debug. As we already have a convenience template
that allows us to access the port based on its name let's make sure
that everyone is using it.

Issue-ID: OOM-1971
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Change-Id: Id25cb9d9e48f39f46786ea9e9a432b0c51130c50

kubernetes/dcaemod/components/dcaemod-healthcheck/templates/deployment.yaml
kubernetes/so/charts/so-ve-vnfm-adapter/resources/config/overrides/override.yaml
kubernetes/so/charts/so-ve-vnfm-adapter/values.yaml

index 64268ab..28d974c 100644 (file)
@@ -36,13 +36,13 @@ spec:
           {{- if eq .Values.liveness.enabled true }}
           livenessProbe:
             tcpSocket:
-              port: {{ ( index .Values.service.ports 0).port }}
+              port: {{ include "common.getPort" (dict "global" . "name" "http") }}
             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
             periodSeconds: {{ .Values.liveness.periodSeconds }}
           {{ end -}}
           readinessProbe:
             tcpSocket:
-              port: {{ ( index .Values.service.ports 0).port }}
+              port: {{ include "common.getPort" (dict "global" . "name" "http") }}
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
           volumeMounts:
index 88d805d..89b6ada 100755 (executable)
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 server:
-  port: {{ (index .Values.service.ports 0).port }}
+  port: {{ include "common.getPort" (dict "global" . "name" "http") }}
 
 vevnfmadapter:
   endpoint: https://msb-iag:30283/api/{{ include "common.servicename" . }}/v1
index d244f7a..0620a0b 100755 (executable)
@@ -50,7 +50,7 @@ service:
           "version": "v1",
           "url": "/",
           "protocol": "REST",
-          "port": "{{ (index .Values.service.ports 0).port }}",
+          "port": "{{ include "common.getPort" (dict "global" . "name" "http") }}",
           "visualRange": "1"
         }
       ]{{ end }}