diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index 067388e468cbbc21267b79b8930cca467a564818..c68b9d69be88de512c6cca216e756aad79d6f46f 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -85,9 +85,9 @@ spec: {{- end }} {{- if eq (.Values.routing).routingStrategy "ZUFI" }} - name: grpc_client_zufi-manager_address - value: {{ required "routing.zufiManager.address must be set when routingStrategy=ZUFI" .Values.routing.zufiManager.address | quote }} + value: {{ required "routing.zufiManager.address must be set when routingStrategy=ZUFI" ((.Values.routing).zufiManager).address | quote }} - name: grpc_client_zufi-manager_negotiationType - value: {{ required "routing.zufiManager.negotiationType must be set when routingStrategy=ZUFI" .Values.routing.zufiManager.negotiationType | quote }} + value: {{ ((.Values.routing).zufiManager).negotiationType | default "PLAINTEXT" }} {{- end }} {{- with include "app.getCustomList" . }} diff --git a/src/test/helm/deployment_routing_zufi_test.yaml b/src/test/helm/deployment_routing_zufi_test.yaml index 843fbb23eba05f4de7faa6132e82d5ed7d5a9b31..85c3e1b73b83bca9bc5f183d2a4a03bb96963d3b 100644 --- a/src/test/helm/deployment_routing_zufi_test.yaml +++ b/src/test/helm/deployment_routing_zufi_test.yaml @@ -39,7 +39,7 @@ tests: routingStrategy: "ZUFI" zufiManager: address: "127.0.0.1" - negotiationType: "PLAINTEXT" + negotiationType: "TLS" asserts: - contains: path: spec.template.spec.containers[0].env @@ -50,7 +50,7 @@ tests: path: spec.template.spec.containers[0].env content: name: grpc_client_zufi-manager_negotiationType - value: "PLAINTEXT" + value: "TLS" - it: should not set zufi routing values when zufi is disabled asserts: @@ -75,12 +75,15 @@ tests: - failedTemplate: errorMessage: "routing.zufiManager.address must be set when routingStrategy=ZUFI" - - it: should throw error if zufi manager negotiationType is not set + - it: should set default value for zufi negotiationType set: routing: routingStrategy: "ZUFI" zufiManager: address: "127.0.0.1" asserts: - - failedTemplate: - errorMessage: "routing.zufiManager.negotiationType must be set when routingStrategy=ZUFI" \ No newline at end of file + - contains: + path: spec.template.spec.containers[0].env + content: + name: grpc_client_zufi-manager_negotiationType + value: "PLAINTEXT" \ No newline at end of file diff --git a/xta-adapter/src/main/helm/templates/xta_adapter_cronjob.yaml b/xta-adapter/src/main/helm/templates/xta_adapter_cronjob.yaml index 89a7a16d280eb788d2a2f21098076b0cfdbfca37..3835e3ec440eebbd71cdb1bb5c21bf366add83c6 100644 --- a/xta-adapter/src/main/helm/templates/xta_adapter_cronjob.yaml +++ b/xta-adapter/src/main/helm/templates/xta_adapter_cronjob.yaml @@ -87,9 +87,9 @@ spec: {{- end }} {{- if eq (.Values.routing).routingStrategy "ZUFI" }} - name: grpc_client_zufi-manager_address - value: {{ required "routing.zufiManager.address must be set when routingStrategy=ZUFI" .Values.routing.zufiManager.address | quote }} + value: {{ required "routing.zufiManager.address must be set when routingStrategy=ZUFI" ((.Values.routing).zufiManager).address | quote }} - name: grpc_client_zufi-manager_negotiationType - value: {{ required "routing.zufiManager.negotiationType must be set when routingStrategy=ZUFI" .Values.routing.zufiManager.negotiationType | quote }} + value: {{ ((.Values.routing).zufiManager).negotiationType | default "PLAINTEXT" }} {{- end }} {{- with include "app.getCustomList" . }} {{ . | indent 16 }} diff --git a/xta-adapter/src/test/helm/xta_adapter_cronjob_routing_zufi_test.yaml b/xta-adapter/src/test/helm/xta_adapter_cronjob_routing_zufi_test.yaml index 80042aafbd72238571931cf602efd7e6554da9b5..1414a4e8248f7fa5985c23322f4f39367fe74603 100644 --- a/xta-adapter/src/test/helm/xta_adapter_cronjob_routing_zufi_test.yaml +++ b/xta-adapter/src/test/helm/xta_adapter_cronjob_routing_zufi_test.yaml @@ -38,7 +38,7 @@ tests: routingStrategy: "ZUFI" zufiManager: address: "127.0.0.1" - negotiationType: "PLAINTEXT" + negotiationType: "TLS" asserts: - contains: path: spec.jobTemplate.spec.template.spec.containers[0].env @@ -49,7 +49,7 @@ tests: path: spec.jobTemplate.spec.template.spec.containers[0].env content: name: grpc_client_zufi-manager_negotiationType - value: "PLAINTEXT" + value: "TLS" - it: should not set zufi routing values when zufi is disabled asserts: @@ -74,12 +74,15 @@ tests: - failedTemplate: errorMessage: "routing.zufiManager.address must be set when routingStrategy=ZUFI" - - it: should throw error if zufi manager negotiationType is not set + - it: should set default value for zufi negotiationType set: routing: routingStrategy: "ZUFI" zufiManager: address: "127.0.0.1" asserts: - - failedTemplate: - errorMessage: "routing.zufiManager.negotiationType must be set when routingStrategy=ZUFI" \ No newline at end of file + - contains: + path: spec.jobTemplate.spec.template.spec.containers[0].env + content: + name: grpc_client_zufi-manager_negotiationType + value: "PLAINTEXT" \ No newline at end of file