Skip to content

Commit

Permalink
Merge branch 'main' into mlavacca/issue-72
Browse files Browse the repository at this point in the history
  • Loading branch information
mlavacca authored May 20, 2024
2 parents 864df82 + 7c90169 commit 8614bc1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion controller/gateway/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
5 changes: 5 additions & 0 deletions pkg/utils/test/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down
13 changes: 4 additions & 9 deletions test/conformance/conformance_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package conformance

import (
"flag"
"fmt"
"os"
"path"
Expand All @@ -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"
Expand All @@ -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()

Expand Down Expand Up @@ -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(
Expand All @@ -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.:
Expand Down
3 changes: 2 additions & 1 deletion test/conformance/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()))
}

Expand Down

0 comments on commit 8614bc1

Please sign in to comment.