diff --git a/src/main/helm/templates/service.yaml b/src/main/helm/templates/service.yaml index 80b44f3d921f4e5c5e6bd11ecfccc298715cb0c8..a85dbf18ec1edfbaffa7602abfe2014bff480a06 100644 --- a/src/main/helm/templates/service.yaml +++ b/src/main/helm/templates/service.yaml @@ -32,9 +32,11 @@ metadata: component: eingang-adapter-service spec: ports: + {{- if (.Values.forwarding).enabled }} - name: grpc-9090 port: 9090 protocol: TCP + {{- end }} - name: http port: 8080 protocol: TCP diff --git a/src/test/helm/service_test.yaml b/src/test/helm/service_test.yaml index 0f7db44d7721bd78b3770b89a6e12f8813585ace..41a970a9f61b07cfd799769d489f288ae8307c98 100644 --- a/src/test/helm/service_test.yaml +++ b/src/test/helm/service_test.yaml @@ -49,7 +49,10 @@ tests: - equal: path: spec.type value: ClusterIP - - it: ports should contain the grpc port + - it: should contain the grpc port in the ports list if forwarding enabled + set: + forwarding: + enabled: true asserts: - contains: path: spec.ports @@ -59,6 +62,19 @@ tests: protocol: TCP count: 1 any: true + - it: should not contain the grpc port in the ports list if forwarding disabled + set: + forwarding: + enabled: false + asserts: + - notContains: + path: spec.ports + content: + name: grpc-9090 + port: 9090 + protocol: TCP + count: 1 + any: true - it: ports should contain the 8080 default http port asserts: - contains: