Skip to content

Commit

Permalink
remove port testing
Browse files Browse the repository at this point in the history
  • Loading branch information
missylbytes committed Aug 1, 2023
1 parent 918918a commit bfe17a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion charts/consul/templates/connect-inject-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ spec:
{{- if .Values.global.openshift.enabled }}
-enable-openshift \
{{- end }}
-openshift-scc-name={{ .Values.connectInject.apiGateway.openshiftSccName }}
-openshift-scc-name={{ .Values.connectInject.apiGateway.openshiftSccName }} \
{{- if .Values.connectInject.transparentProxy.defaultOverwriteProbes }}
-transparent-proxy-default-overwrite-probes=true \
{{- else }}
Expand Down
6 changes: 1 addition & 5 deletions control-plane/api-gateway/common/translation.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,14 @@ func (t ResourceTranslator) toAPIGatewayListener(gateway gwv1beta1.Gateway, list
return api.APIGatewayListener{
Name: string(listener.Name),
Hostname: DerefStringOr(listener.Hostname, ""),
Port: ToContainerPort(listener.Port),
Port: int(listener.Port),
Protocol: listenerProtocolMap[strings.ToLower(string(listener.Protocol))],
TLS: api.APIGatewayTLSConfiguration{
Certificates: certificates,
},
}, true
}

func ToContainerPort(portNumber gwv1beta1.PortNumber) int {
return int(portNumber) + 2000
}

func (t ResourceTranslator) ToHTTPRoute(route gwv1beta1.HTTPRoute, resources *ResourceMap) *api.HTTPRouteConfigEntry {
namespace := t.Namespace(route.Namespace)

Expand Down
7 changes: 2 additions & 5 deletions control-plane/api-gateway/gatekeeper/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ package gatekeeper

import (
"context"
"k8s.io/apimachinery/pkg/util/intstr"

"github.com/hashicorp/consul-k8s/control-plane/api-gateway/common"
"github.com/hashicorp/consul-k8s/control-plane/api/v1alpha1"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -77,9 +75,8 @@ func (g *Gatekeeper) service(gateway gwv1beta1.Gateway, gcc v1alpha1.GatewayClas
ports = append(ports, corev1.ServicePort{
Name: string(listener.Name),
// only TCP-based services are supported for now
Protocol: corev1.ProtocolTCP,
Port: int32(listener.Port),
TargetPort: intstr.FromInt(common.ToContainerPort(listener.Port)),
Protocol: corev1.ProtocolTCP,
Port: int32(listener.Port),
})

seenPorts[listener.Port] = struct{}{}
Expand Down

0 comments on commit bfe17a9

Please sign in to comment.