diff --git a/examples/namespaced-gatewayapi/kustomization.yaml b/examples/namespaced-gatewayapi/kustomization.yaml index 3e1c1879224..b2c3f6173cd 100644 --- a/examples/namespaced-gatewayapi/kustomization.yaml +++ b/examples/namespaced-gatewayapi/kustomization.yaml @@ -77,13 +77,3 @@ patches: kind: ClusterRole name: contour version: v1 - - patch: |- - - op: add - path: /spec/template/spec/containers/0/args/- - value: --watch-namespaces=projectcontour - target: - group: apps - kind: Deployment - name: contour - version: v1 - diff --git a/internal/provisioner/objects/deployment/deployment_test.go b/internal/provisioner/objects/deployment/deployment_test.go index c53fc85a189..e54889c9575 100644 --- a/internal/provisioner/objects/deployment/deployment_test.go +++ b/internal/provisioner/objects/deployment/deployment_test.go @@ -140,7 +140,7 @@ func TestDesiredDeployment(t *testing.T) { cntr := model.Default(fmt.Sprintf("%s-ns", name), name) icName := "test-ic" cntr.Spec.IngressClassName = &icName - + testNamespaces := "ns1,ns2,ns3" resQutoa := corev1.ResourceRequirements{ Limits: corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("400m"), @@ -164,6 +164,9 @@ func TestDesiredDeployment(t *testing.T) { // Change the Contour log level to test --debug. cntr.Spec.ContourLogLevel = v1alpha1.DebugLog + // Change the Contour watch namespaces falg + cntr.Spec.WatchNamespaces = &testNamespaces + cntr.Spec.ResourceLabels = map[string]string{ "key": "value", } @@ -207,10 +210,14 @@ func TestDesiredDeployment(t *testing.T) { arg = fmt.Sprintf("--kubernetes-debug=%d", cntr.Spec.KubernetesLogLevel) checkContainerHasArg(t, container, arg) + arg = fmt.Sprintf("--watch-namespaces=%s", *cntr.Spec.WatchNamespaces) + checkContainerHasArg(t, container, arg) + checkDeploymentHasNodeSelector(t, deploy, nil) checkDeploymentHasTolerations(t, deploy, nil) checkDeploymentHasResourceRequirements(t, deploy, resQutoa) checkDeploymentHasStrategy(t, deploy, cntr.Spec.ContourDeploymentStrategy) + } func TestNodePlacementDeployment(t *testing.T) {