From 27e6f52ba9bfcefe8a63aa7045c92c0f9c0bb48d Mon Sep 17 00:00:00 2001 From: Israel Blancas Date: Thu, 15 Jun 2023 18:03:48 +0200 Subject: [PATCH] Expose properly the grpc-query port. #2238 Signed-off-by: Israel Blancas --- pkg/deployment/all_in_one.go | 4 ++++ pkg/deployment/query.go | 4 ++++ pkg/service/query_test.go | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/pkg/deployment/all_in_one.go b/pkg/deployment/all_in_one.go index 0f2e24a85..ec54ac234 100644 --- a/pkg/deployment/all_in_one.go +++ b/pkg/deployment/all_in_one.go @@ -185,6 +185,10 @@ func (a *AllInOne) Get() *appsv1.Deployment { ContainerPort: 14268, Name: "c-binary-trft", }, + { + ContainerPort: 16685, + Name: "grpc-query", + }, { ContainerPort: 16686, Name: "query", diff --git a/pkg/deployment/query.go b/pkg/deployment/query.go index ea14ccd72..c3f0aa1ff 100644 --- a/pkg/deployment/query.go +++ b/pkg/deployment/query.go @@ -172,6 +172,10 @@ func (q *Query) Get() *appsv1.Deployment { VolumeMounts: commonSpec.VolumeMounts, EnvFrom: envFromSource, Ports: []corev1.ContainerPort{ + { + ContainerPort: 16685, + Name: "grpc-query", + }, { ContainerPort: 16686, Name: "query", diff --git a/pkg/service/query_test.go b/pkg/service/query_test.go index 2756113ce..02c1fb669 100644 --- a/pkg/service/query_test.go +++ b/pkg/service/query_test.go @@ -24,7 +24,9 @@ func TestQueryServiceNameAndPorts(t *testing.T) { assert.Equal(t, int32(16686), svc.Spec.Ports[0].Port) assert.Equal(t, int32(16685), svc.Spec.Ports[1].Port) assert.Equal(t, "http-query", svc.Spec.Ports[0].Name) + assert.Equal(t, "grpc-query", svc.Spec.Ports[1].Name) assert.Equal(t, intstr.FromInt(16686), svc.Spec.Ports[0].TargetPort) + assert.Equal(t, intstr.FromInt(16685), svc.Spec.Ports[1].TargetPort) assert.Len(t, svc.Spec.ClusterIP, 0) // make sure we get a cluster IP assert.Equal(t, svc.Spec.Type, corev1.ServiceTypeClusterIP) // make sure we get a ClusterIP service } @@ -87,7 +89,9 @@ func TestQueryServiceLoadBalancerWithIngress(t *testing.T) { assert.Equal(t, int32(16686), svc.Spec.Ports[0].Port) assert.Equal(t, int32(16685), svc.Spec.Ports[1].Port) assert.Equal(t, "http-query", svc.Spec.Ports[0].Name) + assert.Equal(t, "grpc-query", svc.Spec.Ports[1].Name) assert.Equal(t, intstr.FromInt(16686), svc.Spec.Ports[0].TargetPort) + assert.Equal(t, intstr.FromInt(16685), svc.Spec.Ports[1].TargetPort) assert.Equal(t, svc.Spec.Type, corev1.ServiceTypeLoadBalancer) // make sure we get a LoadBalancer service }