Skip to content

Commit

Permalink
tests: fix feature gates used in TestDeployAllInOneDBLESSGateway (#5832)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Apr 8, 2024
1 parent 6038c87 commit 5701912
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/e2e/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

"github.com/kong/kubernetes-ingress-controller/v3/internal/annotations"
"github.com/kong/kubernetes-ingress-controller/v3/internal/gatewayapi"
"github.com/kong/kubernetes-ingress-controller/v3/internal/manager/featuregates"
"github.com/kong/kubernetes-ingress-controller/v3/internal/util"
kongv1 "github.com/kong/kubernetes-ingress-controller/v3/pkg/apis/configuration/v1"
"github.com/kong/kubernetes-ingress-controller/v3/pkg/clientset"
Expand Down Expand Up @@ -249,8 +250,13 @@ func TestDeployAllInOneDBLESSGateway(t *testing.T) {
controllerDeployment := deployments.GetController(ctx, t, env)
for i, container := range controllerDeployment.Spec.Template.Spec.Containers {
if container.Name == controllerContainerName {
controllerDeployment.Spec.Template.Spec.Containers[i].Env = append(controllerDeployment.Spec.Template.Spec.Containers[i].Env,
corev1.EnvVar{Name: "CONTROLLER_FEATURE_GATES", Value: testenv.GetFeatureGates()})
controllerDeployment.Spec.Template.Spec.Containers[i].Env = append(
controllerDeployment.Spec.Template.Spec.Containers[i].Env,
corev1.EnvVar{
Name: "CONTROLLER_FEATURE_GATES",
Value: fmt.Sprintf("%s=true", featuregates.GatewayAlphaFeature),
},
)
}
}

Expand All @@ -263,6 +269,7 @@ func TestDeployAllInOneDBLESSGateway(t *testing.T) {
require.NoError(t, err)

expectedMsg := "Required CustomResourceDefinitions are not installed, setting up a watch for them in case they are installed afterward"
t.Logf("checking logs of #%d pods", len(pods.Items))
for _, pod := range pods.Items {
logs, err := getPodLogs(ctx, t, env, pod.Namespace, pod.Name)
if err != nil {
Expand All @@ -274,7 +281,7 @@ func TestDeployAllInOneDBLESSGateway(t *testing.T) {
}
}
return true
}, time.Minute, 5*time.Second)
}, time.Minute, 3*time.Second)

t.Logf("deploying Gateway APIs CRDs in standard channel from %s", consts.GatewayStandardCRDsKustomizeURL)
require.NoError(t, clusters.KustomizeDeployForCluster(ctx, env.Cluster(), consts.GatewayStandardCRDsKustomizeURL))
Expand Down

0 comments on commit 5701912

Please sign in to comment.