Skip to content

Commit

Permalink
tests: fix feature gates used in TestDeployAllInOneDBLESSGateway (#5832
Browse files Browse the repository at this point in the history
…) (#5833)

(cherry picked from commit 5701912)

Co-authored-by: Patryk Małek <patryk.malek@konghq.com>
  • Loading branch information
team-k8s-bot and pmalek authored Apr 8, 2024
1 parent 9af1396 commit afa745c
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 afa745c

Please sign in to comment.