Skip to content

Commit

Permalink
integration tests fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Aug 24, 2023
1 parent 55a0de4 commit a38a4f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion internal/controllers/gateway/gateway_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,10 @@ func (r *GatewayReconciler) determineServiceForGateway(ctx context.Context, ref
var name k8stypes.NamespacedName
switch {
case ref == r.PublishServiceRef.String():
if protocol == gatewayv1beta1.HTTPProtocolType || protocol == gatewayv1beta1.HTTPSProtocolType || protocol == gatewayv1beta1.TCPProtocolType {
if protocol == gatewayv1beta1.HTTPProtocolType ||
protocol == gatewayv1beta1.HTTPSProtocolType ||
protocol == gatewayv1beta1.TCPProtocolType ||
r.PublishServiceTLSRef.IsAbsent() && protocol == TLSProtocolType {
name = r.PublishServiceRef
}
case r.PublishServiceUDPRef.IsPresent() && ref == r.PublishServiceUDPRef.MustGet().String():
Expand Down
7 changes: 4 additions & 3 deletions test/conformance/gateway_conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package conformance

import (
"fmt"
"strings"
"testing"

"github.com/google/uuid"
Expand Down Expand Up @@ -104,9 +105,10 @@ func TestGatewayConformance(t *testing.T) {
// This service creation is a temporary solution, intended to be replaced by
// https://github.com/Kong/charts/issues/848
t.Log("creating tls service for gateway conformance tests")
svcNameSuffix, _, _ := strings.Cut(uuid.NewString(), "-")
tlsService := &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Name: "tls-proxy-" + uuid.NewString(),
Name: "ingress-controller-kong-tls-proxy-" + svcNameSuffix,
Namespace: "kong-system",
},
Spec: corev1.ServiceSpec{
Expand Down Expand Up @@ -179,11 +181,10 @@ func TestGatewayConformance(t *testing.T) {
GatewayClassName: gatewayClass.Name,
Debug: showDebug,
CleanupBaseResources: shouldCleanup,
EnableAllSupportedFeatures: enableAllSupportedFeatures,
ExemptFeatures: exemptFeatures,
BaseManifests: conformanceTestsBaseManifests,
SkipTests: skippedTests,
EnableAllSupportedFeatures: false,
SupportedFeatures: suite.TLSCoreFeatures,
})
cSuite.Setup(t)
// To work with individual tests only, you can disable the normal Run call and construct a slice containing a
Expand Down

0 comments on commit a38a4f1

Please sign in to comment.