diff --git a/src/main/helm/templates/service.yaml b/src/main/helm/templates/service.yaml index 78dc3c5b829499baefca93b05a687ef8ae9e505c..a85dbf18ec1edfbaffa7602abfe2014bff480a06 100644 --- a/src/main/helm/templates/service.yaml +++ b/src/main/helm/templates/service.yaml @@ -32,6 +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 16119984faba0163af487fd9d4f6296c38c79a44..41a970a9f61b07cfd799769d489f288ae8307c98 100644 --- a/src/test/helm/service_test.yaml +++ b/src/test/helm/service_test.yaml @@ -49,6 +49,32 @@ tests: - equal: path: spec.type value: ClusterIP + - it: should contain the grpc port in the ports list if forwarding enabled + set: + forwarding: + enabled: true + asserts: + - contains: + path: spec.ports + content: + name: grpc-9090 + port: 9090 + 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: