diff --git a/controller/gateway/controller.go b/controller/gateway/controller.go index 6078bbb6b..c964564a9 100644 --- a/controller/gateway/controller.go +++ b/controller/gateway/controller.go @@ -172,7 +172,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu } // If the Gateway is not accepted, do not move on in the reconciliation logic. if acceptedCondition.Status == metav1.ConditionFalse { - // TODO: clean up Dataplane and Controlplane https://github.com/Kong/gateway-operator/issues/1511 + // TODO: clean up Dataplane and Controlplane https://github.com/Kong/gateway-operator/issues/126 return ctrl.Result{}, nil } diff --git a/go.mod b/go.mod index 3977c3f5e..6f2b905e3 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/cloudflare/cfssl v1.6.5 github.com/go-logr/logr v1.4.1 github.com/google/uuid v1.6.0 - github.com/kong/kubernetes-ingress-controller/v3 v3.1.4 + github.com/kong/kubernetes-ingress-controller/v3 v3.1.5 github.com/kong/kubernetes-telemetry v0.1.3 github.com/kong/kubernetes-testing-framework v0.47.0 github.com/kong/semver/v4 v4.0.1 diff --git a/go.sum b/go.sum index 2ab1900b0..544fb96f1 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,8 @@ github.com/bombsimon/logrusr/v3 v3.1.0 h1:zORbLM943D+hDMGgyjMhSAz/iDz86ZV72qaak/ github.com/bombsimon/logrusr/v3 v3.1.0/go.mod h1:PksPPgSFEL2I52pla2glgCyyd2OqOHAnFF5E+g8Ixco= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cert-manager/cert-manager v1.14.5 h1:uuM1O2g2S80nxiH3eW2cZYMGiL2zmDFVdAzg8sibWuc= github.com/cert-manager/cert-manager v1.14.5/go.mod h1:fmr/cU5jiLxWj69CroDggSOa49RljUK+dU583TaQUXM= @@ -221,8 +221,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kong/go-kong v0.54.0 h1:HZkZJRREJs/azkgJxMWr2jANQQfg8xXsAiFKu+d1nrs= github.com/kong/go-kong v0.54.0/go.mod h1:51rSSjgSZKukXgn5nNYbJUx0Et/islqR+LTltwCyjG8= -github.com/kong/kubernetes-ingress-controller/v3 v3.1.4 h1:90SeWeW+6tj9tsgOO6/P0SprN3bgFzVbGdQli4jzPes= -github.com/kong/kubernetes-ingress-controller/v3 v3.1.4/go.mod h1:d7wYixK3JDUKjyyX6kS4tMJIfyBBSa0vD/+uaNpPO7U= +github.com/kong/kubernetes-ingress-controller/v3 v3.1.5 h1:fkrt2p6/8uavGUqo+OpUJ9jjGDHvyfZQa4sLzu0a1HU= +github.com/kong/kubernetes-ingress-controller/v3 v3.1.5/go.mod h1:+ZBwo4iHZDPagoZVYiYjUCJF+umEZydiqRDDFGxR5wc= github.com/kong/kubernetes-telemetry v0.1.3 h1:Hz2tkHGIIUqbn1x46QRDmmNjbEtJyxyOvHSPne3uPto= github.com/kong/kubernetes-telemetry v0.1.3/go.mod h1:wB7o8dOKa5R396CyiU0sPa8am/g3c5DKd/qrn/Vmb+k= github.com/kong/kubernetes-testing-framework v0.47.0 h1:+9AfTinsGwtxVOcQ/dsDDpwHr4YPpXogKc0THauYJjA= diff --git a/pkg/utils/test/clients.go b/pkg/utils/test/clients.go index 8f10871dd..8e364c9ff 100644 --- a/pkg/utils/test/clients.go +++ b/pkg/utils/test/clients.go @@ -2,6 +2,7 @@ package test import ( "github.com/kong/kubernetes-testing-framework/pkg/environments" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" kubernetesclient "k8s.io/client-go/kubernetes" ctrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client" gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" @@ -40,6 +41,10 @@ func NewK8sClients(env environments.Environment) (K8sClients, error) { if err != nil { return clients, err } + + if err := apiextensionsv1.AddToScheme(clients.MgrClient.Scheme()); err != nil { + return clients, err + } if err := gatewayv1.Install(clients.MgrClient.Scheme()); err != nil { return clients, err } diff --git a/test/conformance/conformance_test.go b/test/conformance/conformance_test.go index 9b8e18943..47fb6fe25 100644 --- a/test/conformance/conformance_test.go +++ b/test/conformance/conformance_test.go @@ -1,7 +1,6 @@ package conformance import ( - "flag" "fmt" "os" "path" @@ -15,6 +14,7 @@ import ( gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" conformancev1 "sigs.k8s.io/gateway-api/conformance/apis/v1" "sigs.k8s.io/gateway-api/conformance/tests" + "sigs.k8s.io/gateway-api/conformance/utils/flags" "sigs.k8s.io/gateway-api/conformance/utils/suite" "github.com/kong/gateway-operator/internal/metadata" @@ -32,11 +32,6 @@ var skippedTests = []string{ tests.HTTPRouteHeaderMatching.ShortName, } -var ( - shouldCleanup = flag.Bool("cleanup", true, "indicates whether or not the base test resources such as Gateways should be cleaned up after the run.") - showDebug = flag.Bool("debug", false, "indicates whether to execute the conformance tests in debug mode.") -) - func TestGatewayConformance(t *testing.T) { t.Parallel() @@ -64,8 +59,8 @@ func TestGatewayConformance(t *testing.T) { suite.ConformanceOptions{ Client: clients.MgrClient, GatewayClassName: gwc.Name, - Debug: *showDebug, - CleanupBaseResources: *shouldCleanup, + Debug: *flags.ShowDebug, + CleanupBaseResources: *flags.CleanupBaseResources, BaseManifests: conformanceTestsBaseManifests, SkipTests: skippedTests, ConformanceProfiles: sets.New( @@ -85,7 +80,7 @@ func TestGatewayConformance(t *testing.T) { require.NoError(t, err) t.Log("starting the gateway conformance test suite") - cSuite.Setup(t, nil) + cSuite.Setup(t, tests.ConformanceTests) // To work with individual tests only, you can disable the normal Run call and construct a slice containing a // single test only, e.g.: diff --git a/test/conformance/suite_test.go b/test/conformance/suite_test.go index ec11f9b34..864b9b54e 100644 --- a/test/conformance/suite_test.go +++ b/test/conformance/suite_test.go @@ -15,6 +15,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/gateway-api/conformance/utils/flags" gwapiv1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1" "github.com/kong/gateway-operator/config" @@ -126,7 +127,7 @@ func TestMain(m *testing.M) { // for the operator to handle Gateway finalizers. // If we don't do it then we'll be left with Gateways that have a deleted // timestamp and finalizers set but no operator running which could handle those. - if *shouldCleanup { + if *flags.CleanupBaseResources { exitOnErr(waitForConformanceGatewaysToCleanup(ctx, clients.GatewayClient.GatewayV1())) }