From 27e877a3fa9f023b2bed8ad0c6a1fb289bbb86bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Fri, 14 Feb 2025 14:35:37 +0100 Subject: [PATCH] fix(konnect): do not set owner relationship between ControlPlane and its config entities (#1099) * fix(konnect): do not set owner relationship between ControlPlane and its config entities * chore: increase the linter timeout * chore: simplify setProrammedStatusConditionBasedOnOtherConditions call site * chore: refactor AreAllConditionsHaveTrueStatus * chore: deploy.KongConsumerAttachedToCP -> deploy.KongConsumer * chore: fix build * update deps Signed-off-by: Jintao Zhang --------- Signed-off-by: Jintao Zhang Co-authored-by: Jintao Zhang --- .golangci.yaml | 2 +- CHANGELOG.md | 4 + .../konnect/reconciler_controlplaneref.go | 25 --- .../reconciler_controlplaneref_test.go | 5 +- controller/konnect/reconciler_generic.go | 35 +++- go.mod | 156 +++++++------- go.sum | 193 +++++++++--------- hack/generators/go.mod | 18 +- hack/generators/go.sum | 40 ++-- pkg/utils/kubernetes/status.go | 19 +- test/envtest/condition_asserts.go | 53 +++++ .../envtest/kongpluginbinding_managed_test.go | 22 +- .../kongpluginbinding_unmanaged_test.go | 32 ++- .../kongplugincleanupfinalizer_test.go | 13 +- ...konnect_entities_kongcacertificate_test.go | 59 ++++++ .../konnect_entities_kongcertificate_test.go | 59 ++++++ .../konnect_entities_kongconsumer_test.go | 88 +++++++- ...konnect_entities_kongconsumergroup_test.go | 68 +++++- ...ies_kongdataplaneclientcertificate_test.go | 58 +++++- test/envtest/konnect_entities_kongkey_test.go | 103 ++++++++-- .../konnect_entities_kongkeyset_test.go | 69 ++++++- .../konnect_entities_kongroute_test.go | 4 +- .../konnect_entities_kongservice_test.go | 80 +++++++- .../konnect_entities_kongtarget_test.go | 4 +- .../konnect_entities_kongupstream_test.go | 66 +++++- test/helpers/deploy/deploy_resources.go | 129 +++++------- test/integration/test_konnect_entities.go | 12 +- 27 files changed, 1032 insertions(+), 384 deletions(-) create mode 100644 test/envtest/condition_asserts.go diff --git a/.golangci.yaml b/.golangci.yaml index 21321c40e..165df3242 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,5 +1,5 @@ run: - timeout: 5m + timeout: 8m linters: enable: - asciicheck diff --git a/CHANGELOG.md b/CHANGELOG.md index 9532a7e88..636115ae0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -115,6 +115,10 @@ have any effect. They will be removed in next major release. [#1100](https://github.com/Kong/gateway-operator/pull/1100) +- Konnect entities that are attached to a Konnect CP through a `ControlPlaneRef` + do not get an owner relationship set to the `ControlPlane` anymore hence + they are not deleted when the `ControlPlane` is deleted. + [#1099](https://github.com/Kong/gateway-operator/pull/1099) [kubebuilder_3907]: https://github.com/kubernetes-sigs/kubebuilder/discussions/3907 diff --git a/controller/konnect/reconciler_controlplaneref.go b/controller/konnect/reconciler_controlplaneref.go index e8297c9d1..bfab4c4ac 100644 --- a/controller/konnect/reconciler_controlplaneref.go +++ b/controller/konnect/reconciler_controlplaneref.go @@ -11,7 +11,6 @@ import ( "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ctrllog "sigs.k8s.io/controller-runtime/pkg/log" "github.com/kong/gateway-operator/controller/konnect/constraints" @@ -152,30 +151,6 @@ func handleControlPlaneRef[T constraints.SupportedKonnectEntityType, TEnt constr return ctrl.Result{Requeue: true}, nil } - var ( - old = ent.DeepCopyObject().(TEnt) - - // A cluster scoped object cannot set a namespaced object as its owner, and also we cannot set cross namespaced owner reference. - // So we skip setting owner reference for cluster scoped resources (KongVault). - // TODO: handle cross namespace refs - isNamespaceScoped = ent.GetNamespace() != "" - - // If an entity has another owner, we should not set the owner reference as that would prevent the entity from being deleted. - hasNoOwners = len(ent.GetOwnerReferences()) == 0 - ) - if isNamespaceScoped && hasNoOwners { - if err := controllerutil.SetOwnerReference(cp, ent, cl.Scheme(), controllerutil.WithBlockOwnerDeletion(true)); err != nil { - return ctrl.Result{}, fmt.Errorf("failed to set owner reference: %w", err) - } - } - - if err := cl.Patch(ctx, ent, client.MergeFrom(old)); err != nil { - if k8serrors.IsConflict(err) { - return ctrl.Result{Requeue: true}, nil - } - return ctrl.Result{}, fmt.Errorf("failed to update status: %w", err) - } - if resource, ok := any(ent).(EntityWithControlPlaneRef); ok { old := ent.DeepCopyObject().(TEnt) resource.SetControlPlaneID(cp.Status.ID) diff --git a/controller/konnect/reconciler_controlplaneref_test.go b/controller/konnect/reconciler_controlplaneref_test.go index 05ce41e92..36cd13122 100644 --- a/controller/konnect/reconciler_controlplaneref_test.go +++ b/controller/konnect/reconciler_controlplaneref_test.go @@ -181,9 +181,8 @@ func TestHandleControlPlaneRef(t *testing.T) { }), "service should get control plane ID" }, func(svc *configurationv1alpha1.KongService) (bool, string) { - return lo.ContainsBy(svc.OwnerReferences, func(o metav1.OwnerReference) bool { - return o.Kind == "KonnectGatewayControlPlane" && o.Name == "cp-ok" - }), "service should have owner reference set to CP" + return len(svc.OwnerReferences) == 0, + "service should have 0 owner references" }, func(svc *configurationv1alpha1.KongService) (bool, string) { return lo.ContainsBy(svc.Status.Conditions, func(c metav1.Condition) bool { diff --git a/controller/konnect/reconciler_generic.go b/controller/konnect/reconciler_generic.go index 2d06839f1..a08f0d01b 100644 --- a/controller/konnect/reconciler_generic.go +++ b/controller/konnect/reconciler_generic.go @@ -160,11 +160,10 @@ func (r *KonnectEntityReconciler[T, TEnt]) Reconcile( // If a type has a ControlPlane ref, handle it. res, err := handleControlPlaneRef(ctx, r.Client, ent) if err != nil || !res.IsZero() { - // If the referenced ControlPlane is not found and the object is deleted, - // remove the finalizer and update the status. + // If the referenced ControlPlane is not found, remove the finalizer and update the status. // There's no need to remove the entity on Konnect because the ControlPlane // does not exist anymore. - if !ent.GetDeletionTimestamp().IsZero() && errors.As(err, &ReferencedControlPlaneDoesNotExistError{}) { + if errors.As(err, &ReferencedControlPlaneDoesNotExistError{}) { if controllerutil.RemoveFinalizer(ent, KonnectCleanupFinalizer) { if err := r.Client.Update(ctx, ent); err != nil { if k8serrors.IsConflict(err) { @@ -174,8 +173,8 @@ func (r *KonnectEntityReconciler[T, TEnt]) Reconcile( } } } - // Status update will requeue the entity. - return ctrl.Result{}, nil + + return setProgrammedStatusConditionBasedOnOtherConditions(ctx, r.Client, ent) } // If a type has a KongService ref, handle it. res, err = handleKongServiceRef(ctx, r.Client, ent) @@ -1009,3 +1008,29 @@ func handleKongConsumerRef[T constraints.SupportedKonnectEntityType, TEnt constr return ctrl.Result{}, nil } + +func setProgrammedStatusConditionBasedOnOtherConditions[ + T interface { + client.Object + k8sutils.ConditionsAware + }, +]( + ctx context.Context, + cl client.Client, + ent T, +) (ctrl.Result, error) { + if k8sutils.AreAllConditionsHaveTrueStatus(ent) { + return ctrl.Result{}, nil + } + + if res, errStatus := patch.StatusWithCondition( + ctx, cl, ent, + konnectv1alpha1.KonnectEntityProgrammedConditionType, + metav1.ConditionFalse, + konnectv1alpha1.KonnectEntityProgrammedReasonConditionWithStatusFalseExists, + "Some conditions have status set to False", + ); errStatus != nil || !res.IsZero() { + return res, errStatus + } + return ctrl.Result{}, nil +} diff --git a/go.mod b/go.mod index 29b18b5a7..3d19845af 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kong/gateway-operator -go 1.23.2 +go 1.24.0 // 1.2.2 was released on main branch with a breaking change that was not // intended to be released in 1.2.x: @@ -19,7 +19,7 @@ require ( github.com/google/go-containerregistry v0.20.3 github.com/google/uuid v1.6.0 github.com/gruntwork-io/terratest v0.48.2 - github.com/kong/kubernetes-configuration v1.1.1-0.20250131124626-916233dcfdcd + github.com/kong/kubernetes-configuration v1.1.1-0.20250206104619-59e9230a3a4c github.com/kong/kubernetes-telemetry v0.1.8 github.com/kong/kubernetes-testing-framework v0.47.2 github.com/kong/semver/v4 v4.0.1 @@ -33,11 +33,11 @@ require ( github.com/tidwall/pretty v1.2.1 go.uber.org/zap v1.27.0 golang.org/x/mod v0.23.0 - k8s.io/api v0.32.1 - k8s.io/apiextensions-apiserver v0.32.1 - k8s.io/apimachinery v0.32.1 - k8s.io/client-go v0.32.1 - k8s.io/kubernetes v1.32.1 + k8s.io/api v0.32.2 + k8s.io/apiextensions-apiserver v0.32.2 + k8s.io/apimachinery v0.32.2 + k8s.io/client-go v0.32.2 + k8s.io/kubernetes v1.32.2 // TODO: Use official release when // https://github.com/oras-project/oras-go/pull/850 becomes part of it. oras.land/oras-go/v2 v2.5.1-0.20250115103459-a15da41d19be @@ -47,7 +47,7 @@ require ( ) require ( - cel.dev/expr v0.18.0 // indirect + cel.dev/expr v0.20.0 // indirect cloud.google.com/go/auth v0.10.2 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.5 // indirect cloud.google.com/go/compute/metadata v0.6.0 // indirect @@ -55,8 +55,8 @@ require ( filippo.io/edwards25519 v1.1.0 // indirect github.com/BurntSushi/toml v1.4.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/antlr4-go/antlr/v4 v4.13.0 // indirect - github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/avast/retry-go/v4 v4.6.0 // indirect github.com/aws/aws-sdk-go-v2 v1.32.5 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect @@ -105,11 +105,11 @@ require ( github.com/docker/docker v27.5.0+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/emicklei/go-restful/v3 v3.12.0 // indirect + github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/ericlagergren/decimal v0.0.0-20240411145413-00de7ca16731 // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/gammazero/deque v0.2.0 // indirect github.com/gammazero/workerpool v1.1.3 // indirect @@ -129,7 +129,7 @@ require ( github.com/gonvenience/text v1.0.7 // indirect github.com/gonvenience/wrap v1.1.2 // indirect github.com/gonvenience/ytbx v1.4.4 // indirect - github.com/google/cel-go v0.22.0 // indirect + github.com/google/cel-go v0.22.1 // indirect github.com/google/certificate-transparency-go v1.1.7 // indirect github.com/google/gnostic-models v0.6.9 // indirect github.com/google/go-github/v48 v48.2.0 // indirect @@ -139,8 +139,8 @@ require ( github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect github.com/googleapis/gax-go/v2 v2.14.0 // indirect - github.com/gorilla/websocket v1.5.1 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect github.com/gruntwork-io/go-commons v0.8.0 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect @@ -158,7 +158,7 @@ require ( github.com/kong/go-kong v0.63.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect + github.com/mailru/easyjson v0.9.0 // indirect github.com/mattn/go-ciede2000 v0.0.0-20170301095244-782e8c62fec3 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect @@ -180,7 +180,7 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/pquerna/otp v1.4.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/puzpuzpuz/xsync/v2 v2.5.1 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect @@ -188,7 +188,7 @@ require ( github.com/sergi/go-diff v1.3.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/cobra v1.8.1 // indirect - github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/pflag v1.0.6 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/texttheater/golang-levenshtein v1.0.1 // indirect @@ -202,35 +202,35 @@ require ( github.com/zmap/zcrypto v0.0.0-20230310154051-c8b263fd8300 // indirect github.com/zmap/zlint/v3 v3.5.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect - go.opentelemetry.io/otel v1.33.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect - go.opentelemetry.io/otel/metric v1.33.0 // indirect - go.opentelemetry.io/otel/sdk v1.33.0 // indirect - go.opentelemetry.io/otel/trace v1.33.0 // indirect - go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect + go.opentelemetry.io/otel v1.34.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect + go.opentelemetry.io/otel/metric v1.34.0 // indirect + go.opentelemetry.io/otel/sdk v1.34.0 // indirect + go.opentelemetry.io/otel/trace v1.34.0 // indirect + go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect - golang.org/x/crypto v0.32.0 // indirect - golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect - golang.org/x/net v0.34.0 // indirect - golang.org/x/tools v0.29.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect + golang.org/x/crypto v0.33.0 // indirect + golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/tools v0.30.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect - k8s.io/apiserver v0.32.1 // indirect + k8s.io/apiserver v0.32.2 // indirect k8s.io/component-helpers v0.0.0 // indirect k8s.io/controller-manager v0.0.0 // indirect - k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 // indirect + k8s.io/utils v0.0.0-20241210054802-24370beab758 + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect ) require ( - golang.org/x/sync v0.10.0 // indirect + golang.org/x/sync v0.11.0 // indirect google.golang.org/api v0.206.0 // indirect - google.golang.org/grpc v1.67.1 // indirect + google.golang.org/grpc v1.70.0 // indirect sigs.k8s.io/kind v0.24.0 // indirect sigs.k8s.io/kustomize/kyaml v0.19.0 ) @@ -240,21 +240,21 @@ require ( github.com/google/btree v1.1.3 // indirect github.com/klauspost/compress v1.17.11 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - golang.org/x/oauth2 v0.25.0 // indirect - golang.org/x/sys v0.29.0 // indirect - golang.org/x/term v0.28.0 // indirect - golang.org/x/text v0.21.0 // indirect - golang.org/x/time v0.8.0 // indirect + golang.org/x/oauth2 v0.26.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.22.0 // indirect + golang.org/x/time v0.10.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/protobuf v1.36.3 // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/component-base v0.32.1 // indirect + k8s.io/component-base v0.32.2 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect - sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect + sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) @@ -263,36 +263,36 @@ require ( // They can be updated with `./hack/update-k8sio-gomod-replace.sh` script. // This is a workaround for https://github.com/Kong/gateway-operator/issues/1384. replace ( - k8s.io/api => k8s.io/api v0.32.1 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.32.1 - k8s.io/apimachinery => k8s.io/apimachinery v0.32.1 - k8s.io/apiserver => k8s.io/apiserver v0.32.1 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.32.1 - k8s.io/client-go => k8s.io/client-go v0.32.1 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.32.1 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.32.1 - k8s.io/code-generator => k8s.io/code-generator v0.32.1 - k8s.io/component-base => k8s.io/component-base v0.32.1 - k8s.io/component-helpers => k8s.io/component-helpers v0.32.1 - k8s.io/controller-manager => k8s.io/controller-manager v0.32.1 - k8s.io/cri-api => k8s.io/cri-api v0.32.1 - k8s.io/cri-client => k8s.io/cri-client v0.32.1 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.32.1 - k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.32.1 - k8s.io/endpointslice => k8s.io/endpointslice v0.32.1 - k8s.io/externaljwt => k8s.io/externaljwt v0.32.1 - k8s.io/kms => k8s.io/kms v0.32.1 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.32.1 - k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.32.1 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.32.1 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.32.1 - k8s.io/kubectl => k8s.io/kubectl v0.32.1 - k8s.io/kubelet => k8s.io/kubelet v0.32.1 + k8s.io/api => k8s.io/api v0.32.2 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.32.2 + k8s.io/apimachinery => k8s.io/apimachinery v0.32.2 + k8s.io/apiserver => k8s.io/apiserver v0.32.2 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.32.2 + k8s.io/client-go => k8s.io/client-go v0.32.2 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.32.2 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.32.2 + k8s.io/code-generator => k8s.io/code-generator v0.32.2 + k8s.io/component-base => k8s.io/component-base v0.32.2 + k8s.io/component-helpers => k8s.io/component-helpers v0.32.2 + k8s.io/controller-manager => k8s.io/controller-manager v0.32.2 + k8s.io/cri-api => k8s.io/cri-api v0.32.2 + k8s.io/cri-client => k8s.io/cri-client v0.32.2 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.32.2 + k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.32.2 + k8s.io/endpointslice => k8s.io/endpointslice v0.32.2 + k8s.io/externaljwt => k8s.io/externaljwt v0.32.2 + k8s.io/kms => k8s.io/kms v0.32.2 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.32.2 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.32.2 + k8s.io/kube-proxy => k8s.io/kube-proxy v0.32.2 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.32.2 + k8s.io/kubectl => k8s.io/kubectl v0.32.2 + k8s.io/kubelet => k8s.io/kubelet v0.32.2 k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.30.3 - k8s.io/metrics => k8s.io/metrics v0.32.1 - k8s.io/mount-utils => k8s.io/mount-utils v0.32.1 - k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.32.1 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.32.1 - k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.32.1 - k8s.io/sample-controller => k8s.io/sample-controller v0.32.1 + k8s.io/metrics => k8s.io/metrics v0.32.2 + k8s.io/mount-utils => k8s.io/mount-utils v0.32.2 + k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.32.2 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.32.2 + k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.32.2 + k8s.io/sample-controller => k8s.io/sample-controller v0.32.2 ) diff --git a/go.sum b/go.sum index 726dcbe1a..84c13a911 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo= -cel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= +cel.dev/expr v0.20.0 h1:OunBvVCfvpWlt4dN7zg3FM6TDkzOePe1+foGJ9AXeeI= +cel.dev/expr v0.20.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE= cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U= @@ -24,12 +24,12 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= -github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinRJA= github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= github.com/aws/aws-sdk-go-v2 v1.32.5 h1:U8vdWJuY7ruAkzaOdD7guwJjD06YSKmnKCJs7s3IkIo= @@ -142,8 +142,8 @@ github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= -github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= +github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -157,8 +157,8 @@ github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gammazero/deque v0.2.0 h1:SkieyNB4bg2/uZZLxvya0Pq6diUlwx7m2TeT7GAIWaA= @@ -223,8 +223,8 @@ github.com/gonvenience/ytbx v1.4.4 h1:jQopwyaLsVGuwdxSiN4WkXjsEaFNPJ3V4lUj7eyEpz github.com/gonvenience/ytbx v1.4.4/go.mod h1:w37+MKCPcCMY/jpPNmEklD4xKqrOAVBO6kIWW2+uI6M= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/cel-go v0.22.0 h1:b3FJZxpiv1vTMo2/5RDUqAHPxkT8mmMfJIrq1llbf7g= -github.com/google/cel-go v0.22.0/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8= +github.com/google/cel-go v0.22.1 h1:AfVXx3chM2qwoSbM7Da8g8hX8OVSkBFwX+rz2+PcK40= +github.com/google/cel-go v0.22.1/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8= github.com/google/certificate-transparency-go v1.1.7 h1:IASD+NtgSTJLPdzkthwvAG1ZVbF2WtFg4IvoA68XGSw= github.com/google/certificate-transparency-go v1.1.7/go.mod h1:FSSBo8fyMVgqptbfF6j5p/XNdgQftAhSmXcIxV9iphE= github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= @@ -265,10 +265,10 @@ github.com/googleapis/gax-go/v2 v2.14.0 h1:f+jMrjBPl+DL9nI4IQzLUxMq7XrAqFYB7hBPq github.com/googleapis/gax-go/v2 v2.14.0/go.mod h1:lhBCnjdLrWRaPvLWhmc8IS24m9mr07qSYnHncrgo+zk= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M= github.com/gruntwork-io/go-commons v0.8.0 h1:k/yypwrPqSeYHevLlEDmvmgQzcyTwrlZGRaxEM6G0ro= github.com/gruntwork-io/go-commons v0.8.0/go.mod h1:gtp0yTtIBExIZp7vyIV9I0XQkVwiQZze678hvDXof78= github.com/gruntwork-io/terratest v0.48.2 h1:+VwfODchq8jxZZWD+s8gBlhD1z6/C4bFLNrhpm9ONrs= @@ -307,8 +307,8 @@ github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IX github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kong/go-kong v0.63.0 h1:8ECLgkgDqON61qCMq/M0gTwZKYxg55Oy692dRDOOBiU= github.com/kong/go-kong v0.63.0/go.mod h1:ma9GWnhkxtrXZlLFfED955HjVzmUojYEHet3lm+PDik= -github.com/kong/kubernetes-configuration v1.1.1-0.20250131124626-916233dcfdcd h1:6tT9I12vgR6/8N6EDWYeteOgpsRB8L2ipQgDn5ChjZo= -github.com/kong/kubernetes-configuration v1.1.1-0.20250131124626-916233dcfdcd/go.mod h1:WAf/rE3AH+y5SUrwG+DVYNCoeI82LUAjT3n4Hu+d20s= +github.com/kong/kubernetes-configuration v1.1.1-0.20250206104619-59e9230a3a4c h1:n+/Ci/ifwlfuy/JVb95jjFSSt5c/P0AozuJreIwvIbo= +github.com/kong/kubernetes-configuration v1.1.1-0.20250206104619-59e9230a3a4c/go.mod h1:wFSxyDrPi3o6m6n/Suj+obbb+WHp4leViuj8POcM9tA= github.com/kong/kubernetes-telemetry v0.1.8 h1:nbtUmXW9xkzRO7dgvrgVrJZiRksATk4XHrqX+78g/5k= github.com/kong/kubernetes-telemetry v0.1.8/go.mod h1:ZEQY/4DddKoe5XA7UTOIbdI/4d6ZRcrzh2ezRxnuyl0= github.com/kong/kubernetes-testing-framework v0.47.2 h1:+2Z9anTpbV/hwNeN+NFQz53BMU+g3QJydkweBp3tULo= @@ -329,8 +329,8 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= +github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mattn/go-ciede2000 v0.0.0-20170301095244-782e8c62fec3 h1:BXxTozrOU8zgC5dkpn3J6NTRdoP+hjok/e+ACr4Hibk= github.com/mattn/go-ciede2000 v0.0.0-20170301095244-782e8c62fec3/go.mod h1:x1uk6vxTiVuNt6S5R2UYgdhpj3oKojXvOXauHZ7dEnI= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -401,8 +401,8 @@ github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/j github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= -github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/puzpuzpuz/xsync/v2 v2.5.1 h1:mVGYAvzDSu52+zaGyNjC+24Xw2bQi3kTr4QJ6N9pIIU= @@ -430,8 +430,9 @@ github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9yS github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -492,26 +493,28 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= -go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= -go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 h1:rgMkmiGfix9vFJDcDi1PK8WEQP4FLQwLDfhp5ZLpFeE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0/go.mod h1:ijPqXp5P6IRRByFVVg9DY8P5HkxkHE5ARIa+86aXPf4= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 h1:wpMfgF8E1rkrT1Z6meFh1NDtownE9Ii3n3X2GJYjsaU= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0/go.mod h1:wAy0T/dUbs468uOlkT31xjvqQgEVXv58BRFWEgn5v/0= -go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= -go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= -go.opentelemetry.io/otel/sdk v1.33.0 h1:iax7M131HuAm9QkZotNHEfstof92xM+N8sr3uHXc2IM= -go.opentelemetry.io/otel/sdk v1.33.0/go.mod h1:A1Q5oi7/9XaMlIWzPSxLRWOI8nG3FnzHJNbiENQuihM= -go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= -go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= -go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= -go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= +go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= +go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -528,11 +531,11 @@ golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac h1:l5+whBCLH3iH2ZNHYLbAe58bo7yrN4mVcnkHDYz5vvs= +golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac/go.mod h1:hH+7mtFmImwwcMvScyxUhjuVHR3HGaDPMn9rMSUUbxo= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -558,11 +561,11 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= -golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE= +golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -570,8 +573,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -588,25 +591,25 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= -golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= -golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4= +golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -617,8 +620,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= -golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= +golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= +golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -632,17 +635,17 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 h1:M0KvPgPmDZHPlbRbaNU1APr28TvwvvdUPlSv7PUvy8g= -google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:dguCy7UOdZhTvLzDyt15+rOrawrpM4q7DD9dQ1P11P4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b h1:i+d0RZa8Hs2L/MuaOQYI+krthcxdEbEM2N+Tf3kJ4zk= +google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b/go.mod h1:iYONQfRdizDB8JJBybql13nArx91jcUk7zCXEsOofM4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b h1:FQtJ1MxbXoIIrZHZ33M+w5+dAP9o86rgpjoKr/ZmT7k= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b/go.mod h1:8BS3B93F/U1juMFq9+EDk+qOT5CO1R9IzXxG3PTqiRk= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= -google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ= +google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -652,8 +655,8 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU= -google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -677,47 +680,47 @@ gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.32.1 h1:f562zw9cy+GvXzXf0CKlVQ7yHJVYzLfL6JAS4kOAaOc= -k8s.io/api v0.32.1/go.mod h1:/Yi/BqkuueW1BgpoePYBRdDYfjPF5sgTr5+YqDZra5k= -k8s.io/apiextensions-apiserver v0.32.1 h1:hjkALhRUeCariC8DiVmb5jj0VjIc1N0DREP32+6UXZw= -k8s.io/apiextensions-apiserver v0.32.1/go.mod h1:sxWIGuGiYov7Io1fAS2X06NjMIk5CbRHc2StSmbaQto= -k8s.io/apimachinery v0.32.1 h1:683ENpaCBjma4CYqsmZyhEzrGz6cjn1MY/X2jB2hkZs= -k8s.io/apimachinery v0.32.1/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= -k8s.io/apiserver v0.32.1 h1:oo0OozRos66WFq87Zc5tclUX2r0mymoVHRq8JmR7Aak= -k8s.io/apiserver v0.32.1/go.mod h1:UcB9tWjBY7aryeI5zAgzVJB/6k7E97bkr1RgqDz0jPw= -k8s.io/client-go v0.32.1 h1:otM0AxdhdBIaQh7l1Q0jQpmo7WOFIk5FFa4bg6YMdUU= -k8s.io/client-go v0.32.1/go.mod h1:aTTKZY7MdxUaJ/KiUs8D+GssR9zJZi77ZqtzcGXIiDg= -k8s.io/component-base v0.32.1 h1:/5IfJ0dHIKBWysGV0yKTFfacZ5yNV1sulPh3ilJjRZk= -k8s.io/component-base v0.32.1/go.mod h1:j1iMMHi/sqAHeG5z+O9BFNCF698a1u0186zkjMZQ28w= -k8s.io/component-helpers v0.32.1 h1:TwdsSM1vW9GjnfX18lkrZbwE5G9psCIS2/rhenTDXd8= -k8s.io/component-helpers v0.32.1/go.mod h1:1JT1Ei3FD29yFQ18F3laj1WyvxYdHIhyxx6adKMFQXI= -k8s.io/controller-manager v0.32.1 h1:z3oQp1O5l0cSzM/MKf8V4olhJ9TmnELoJRPcV/v1s+Y= -k8s.io/controller-manager v0.32.1/go.mod h1:dVA1UZPbqHH4hEhrrnLvQ4d5qVQCklNB8GEzYV59v/4= +k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw= +k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y= +k8s.io/apiextensions-apiserver v0.32.2 h1:2YMk285jWMk2188V2AERy5yDwBYrjgWYggscghPCvV4= +k8s.io/apiextensions-apiserver v0.32.2/go.mod h1:GPwf8sph7YlJT3H6aKUWtd0E+oyShk/YHWQHf/OOgCA= +k8s.io/apimachinery v0.32.2 h1:yoQBR9ZGkA6Rgmhbp/yuT9/g+4lxtsGYwW6dR6BDPLQ= +k8s.io/apimachinery v0.32.2/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/apiserver v0.32.2 h1:WzyxAu4mvLkQxwD9hGa4ZfExo3yZZaYzoYvvVDlM6vw= +k8s.io/apiserver v0.32.2/go.mod h1:PEwREHiHNU2oFdte7BjzA1ZyjWjuckORLIK/wLV5goM= +k8s.io/client-go v0.32.2 h1:4dYCD4Nz+9RApM2b/3BtVvBHw54QjMFUl1OLcJG5yOA= +k8s.io/client-go v0.32.2/go.mod h1:fpZ4oJXclZ3r2nDOv+Ux3XcJutfrwjKTCHz2H3sww94= +k8s.io/component-base v0.32.2 h1:1aUL5Vdmu7qNo4ZsE+569PV5zFatM9hl+lb3dEea2zU= +k8s.io/component-base v0.32.2/go.mod h1:PXJ61Vx9Lg+P5mS8TLd7bCIr+eMJRQTyXe8KvkrvJq0= +k8s.io/component-helpers v0.32.2 h1:2usSAm3zNE5yu5DdAdrKBWLfSYNpU4OPjZywJY5ovP8= +k8s.io/component-helpers v0.32.2/go.mod h1:fvQAoiiOP7jUEUBc9qR0PXiBPuB0I56WTxTkkpcI8g8= +k8s.io/controller-manager v0.32.2 h1:/9XuHWEqofO2Aqa4l7KJGckJUcLVRWfx+qnVkdXoStI= +k8s.io/controller-manager v0.32.2/go.mod h1:o5uo2tLCQhuoMt0RfKcQd0eqaNmSKOKiT+0YELCqXOk= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 h1:hcha5B1kVACrLujCKLbr8XWMxCxzQx42DY8QKYJrDLg= k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7/go.mod h1:GewRfANuJ70iYzvn+i4lezLDAFzvjxZYK1gn1lWcfas= -k8s.io/kubernetes v1.32.1 h1:46YPpIBCT9dkmeglstZ2Gg4LGaAdro1/3IQ+1AfbF1s= -k8s.io/kubernetes v1.32.1/go.mod h1:tiIKO63GcdPRBHW2WiUFm3C0eoLczl3f7qi56Dm1W8I= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kubernetes v1.32.2 h1:mShetlA102UpjRVSGzB+5vjJwy8oPy8FMWrkTH5f37o= +k8s.io/kubernetes v1.32.2/go.mod h1:tiIKO63GcdPRBHW2WiUFm3C0eoLczl3f7qi56Dm1W8I= +k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= +k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= oras.land/oras-go/v2 v2.5.1-0.20250115103459-a15da41d19be h1:KPk9UtQY1BLUOKJcQlIowjZRFofJxPNbD9hEaDnFMIs= oras.land/oras-go/v2 v2.5.1-0.20250115103459-a15da41d19be/go.mod h1:ecS2SG90/ztmqyrxF98+K4Uxq88AqdpZti6DP3g3FZc= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcpeN4baWEV2ko2Z/AsiZgEdwgcfwLgMo= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/controller-runtime v0.20.1 h1:JbGMAG/X94NeM3xvjenVUaBjy6Ui4Ogd/J5ZtjZnHaE= sigs.k8s.io/controller-runtime v0.20.1/go.mod h1:BrP3w158MwvB3ZbNpaAcIKkHQ7YGpYnzpoSTZ8E14WU= sigs.k8s.io/gateway-api v1.2.1 h1:fZZ/+RyRb+Y5tGkwxFKuYuSRQHu9dZtbjenblleOLHM= sigs.k8s.io/gateway-api v1.2.1/go.mod h1:EpNfEXNjiYfUJypf0eZ0P5iXA9ekSGWaS1WgPaM42X0= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= +sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= +sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/kind v0.24.0 h1:g4y4eu0qa+SCeKESLpESgMmVFBebL0BDa6f777OIWrg= sigs.k8s.io/kind v0.24.0/go.mod h1:t7ueEpzPYJvHA8aeLtI52rtFftNgUYUaCwvxjk7phfw= sigs.k8s.io/kustomize/api v0.19.0 h1:F+2HB2mU1MSiR9Hp1NEgoU2q9ItNOaBJl0I4Dlus5SQ= sigs.k8s.io/kustomize/api v0.19.0/go.mod h1:/BbwnivGVcBh1r+8m3tH1VNxJmHSk1PzP5fkP6lbL1o= sigs.k8s.io/kustomize/kyaml v0.19.0 h1:RFge5qsO1uHhwJsu3ipV7RNolC7Uozc0jUBC/61XSlA= sigs.k8s.io/kustomize/kyaml v0.19.0/go.mod h1:FeKD5jEOH+FbZPpqUghBP8mrLjJ3+zD3/rf9NNu1cwY= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= +sigs.k8s.io/structured-merge-diff/v4 v4.5.0 h1:nbCitCK2hfnhyiKo6uf2HxUPTCodY6Qaf85SbDIaMBk= +sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/hack/generators/go.mod b/hack/generators/go.mod index b8e148051..eae7a1648 100644 --- a/hack/generators/go.mod +++ b/hack/generators/go.mod @@ -1,6 +1,6 @@ module github.com/kong/gateway-operator/hack/generators -go 1.23.2 +go 1.24.0 replace github.com/kong/gateway-operator => ../../ @@ -11,8 +11,8 @@ require ( github.com/kong/gateway-operator v0.0.0-00010101000000-000000000000 github.com/kong/semver/v4 v4.0.1 github.com/samber/lo v1.49.1 - k8s.io/api v0.32.1 - k8s.io/apimachinery v0.32.1 + k8s.io/api v0.32.2 + k8s.io/apimachinery v0.32.2 sigs.k8s.io/gateway-api v1.2.1 ) @@ -35,13 +35,13 @@ require ( github.com/shopspring/decimal v1.4.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/x448/float16 v0.8.4 // indirect - golang.org/x/crypto v0.32.0 // indirect - golang.org/x/net v0.34.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/crypto v0.33.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/text v0.22.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect - sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect + k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect + sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/hack/generators/go.sum b/hack/generators/go.sum index 5757c861f..1501e3f28 100644 --- a/hack/generators/go.sum +++ b/hack/generators/go.sum @@ -72,8 +72,8 @@ github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= @@ -85,28 +85,28 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -122,19 +122,19 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.32.1 h1:f562zw9cy+GvXzXf0CKlVQ7yHJVYzLfL6JAS4kOAaOc= -k8s.io/api v0.32.1/go.mod h1:/Yi/BqkuueW1BgpoePYBRdDYfjPF5sgTr5+YqDZra5k= -k8s.io/apimachinery v0.32.1 h1:683ENpaCBjma4CYqsmZyhEzrGz6cjn1MY/X2jB2hkZs= -k8s.io/apimachinery v0.32.1/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw= +k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y= +k8s.io/apimachinery v0.32.2 h1:yoQBR9ZGkA6Rgmhbp/yuT9/g+4lxtsGYwW6dR6BDPLQ= +k8s.io/apimachinery v0.32.2/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= +k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/gateway-api v1.2.1 h1:fZZ/+RyRb+Y5tGkwxFKuYuSRQHu9dZtbjenblleOLHM= sigs.k8s.io/gateway-api v1.2.1/go.mod h1:EpNfEXNjiYfUJypf0eZ0P5iXA9ekSGWaS1WgPaM42X0= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= +sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= +sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/structured-merge-diff/v4 v4.5.0 h1:nbCitCK2hfnhyiKo6uf2HxUPTCodY6Qaf85SbDIaMBk= +sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/pkg/utils/kubernetes/status.go b/pkg/utils/kubernetes/status.go index 760f9f5b3..1a96215da 100644 --- a/pkg/utils/kubernetes/status.go +++ b/pkg/utils/kubernetes/status.go @@ -114,7 +114,7 @@ func SetReadyWithGeneration(resource ConditionsAndGenerationAware, generation in ObservedGeneration: generation, } - if areAllConditionsHaveTrueStatus(resource) { + if AreAllConditionsHaveTrueStatus(resource) { ready.Status = metav1.ConditionTrue ready.Reason = string(consts.ResourceReadyReason) } else { @@ -138,7 +138,7 @@ func SetProgrammed(resource ConditionsAndGenerationAware) { ObservedGeneration: resource.GetGeneration(), } - if areAllConditionsHaveTrueStatus(resource) { + if AreAllConditionsHaveTrueStatus(resource) { programmed.Status = metav1.ConditionTrue programmed.Reason = string(gatewayv1.GatewayReasonProgrammed) } else { @@ -195,13 +195,18 @@ func SetAcceptedConditionOnGateway(resource ConditionsAndListenerConditionsAndGe } } -func areAllConditionsHaveTrueStatus(resource ConditionsAware) bool { +// AreAllConditionsHaveTrueStatus checks if all the conditions on the resource are in the True state. +// It skips the Programmed condition as that particular condition will be set based on +// the return value of this function. +func AreAllConditionsHaveTrueStatus(resource ConditionsAware) bool { for _, condition := range resource.GetConditions() { - if condition.Type == string(gatewayv1.GatewayConditionProgrammed) { + switch condition.Type { + case string(consts.ReadyType), string(gatewayv1.GatewayConditionProgrammed): continue - } - if condition.Type != string(consts.ReadyType) && condition.Status != metav1.ConditionTrue { - return false + default: + if condition.Status != metav1.ConditionTrue { + return false + } } } return true diff --git a/test/envtest/condition_asserts.go b/test/envtest/condition_asserts.go new file mode 100644 index 000000000..fb4fc8501 --- /dev/null +++ b/test/envtest/condition_asserts.go @@ -0,0 +1,53 @@ +package envtest + +import ( + "sigs.k8s.io/controller-runtime/pkg/client" + + k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes" + + configurationv1alpha1 "github.com/kong/kubernetes-configuration/api/configuration/v1alpha1" + konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1" +) + +func conditionsAreSetWhenReferencedControlPlaneIsMissing[ + T interface { + client.Object + k8sutils.ConditionsAware + GetControlPlaneRef() *configurationv1alpha1.ControlPlaneRef + }, +](objToMatch T) func(obj T) bool { + return func(obj T) bool { + if obj.GetName() != objToMatch.GetName() { + return false + } + if obj.GetControlPlaneRef().Type != configurationv1alpha1.ControlPlaneRefKonnectID { + return false + } + condCpRef, okCPRef := k8sutils.GetCondition(konnectv1alpha1.ControlPlaneRefValidConditionType, obj) + condProgrammed, okProgrammed := k8sutils.GetCondition(konnectv1alpha1.KonnectEntityProgrammedConditionType, obj) + return okCPRef && okProgrammed && + condCpRef.Status == "False" && + condProgrammed.Status == "False" && + condCpRef.Reason == konnectv1alpha1.ControlPlaneRefReasonInvalid && + condProgrammed.Reason == konnectv1alpha1.KonnectEntityProgrammedReasonConditionWithStatusFalseExists + } +} + +func conditionProgrammedIsSetToTrue[ + T interface { + client.Object + k8sutils.ConditionsAware + GetControlPlaneRef() *configurationv1alpha1.ControlPlaneRef + GetKonnectID() string + }, +](objToMatch T, id string) func(T) bool { + return func(obj T) bool { + if obj.GetName() != objToMatch.GetName() { + return false + } + if obj.GetControlPlaneRef().Type != configurationv1alpha1.ControlPlaneRefKonnectID { + return false + } + return obj.GetKonnectID() == id && k8sutils.IsProgrammed(obj) + } +} diff --git a/test/envtest/kongpluginbinding_managed_test.go b/test/envtest/kongpluginbinding_managed_test.go index d02c6c70b..ee18deb5e 100644 --- a/test/envtest/kongpluginbinding_managed_test.go +++ b/test/envtest/kongpluginbinding_managed_test.go @@ -109,7 +109,8 @@ func TestKongPluginBindingManaged(t *testing.T) { wKongPluginBinding := setupWatch[configurationv1alpha1.KongPluginBindingList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) wKongPlugin := setupWatch[configurationv1.KongPluginList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp, + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithAnnotation(metadata.AnnotationKeyPlugins, rateLimitingkongPlugin.Name), ) t.Cleanup(func() { @@ -211,7 +212,9 @@ func TestKongPluginBindingManaged(t *testing.T) { wKongPluginBinding := setupWatch[configurationv1alpha1.KongPluginBindingList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) wKongPlugin := setupWatch[configurationv1.KongPluginList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp) + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) t.Cleanup(func() { require.NoError(t, clientNamespaced.Delete(ctx, kongService)) }) @@ -317,7 +320,8 @@ func TestKongPluginBindingManaged(t *testing.T) { wKongPluginBinding := setupWatch[configurationv1alpha1.KongPluginBindingList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) wKongPlugin := setupWatch[configurationv1.KongPluginList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp, + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithAnnotation(metadata.AnnotationKeyPlugins, rateLimitingkongPlugin.Name), ) t.Cleanup(func() { @@ -445,7 +449,8 @@ func TestKongPluginBindingManaged(t *testing.T) { wKongPluginBinding := setupWatch[configurationv1alpha1.KongPluginBindingList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) wKongPlugin := setupWatch[configurationv1.KongPluginList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp, + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithAnnotation(metadata.AnnotationKeyPlugins, rateLimitingkongPlugin.Name), ) t.Cleanup(func() { @@ -459,7 +464,8 @@ func TestKongPluginBindingManaged(t *testing.T) { require.NoError(t, clientNamespaced.Delete(ctx, kongRoute)) }) updateKongRouteStatusWithProgrammed(t, ctx, clientNamespaced, kongRoute, routeID, cp.GetKonnectStatus().GetKonnectID(), serviceID) - kongConsumer := deploy.KongConsumerAttachedToCP(t, ctx, clientNamespaced, "username-1", cp, + kongConsumer := deploy.KongConsumer(t, ctx, clientNamespaced, "username-1", + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithAnnotation(metadata.AnnotationKeyPlugins, rateLimitingkongPlugin.Name), ) t.Cleanup(func() { @@ -644,7 +650,8 @@ func TestKongPluginBindingManaged(t *testing.T) { wKongPluginBinding := setupWatch[configurationv1alpha1.KongPluginBindingList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) wKongPlugin := setupWatch[configurationv1.KongPluginList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp, + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithAnnotation(metadata.AnnotationKeyPlugins, rateLimitingkongPlugin.Name), ) t.Cleanup(func() { @@ -658,7 +665,8 @@ func TestKongPluginBindingManaged(t *testing.T) { require.NoError(t, clientNamespaced.Delete(ctx, kongRoute)) }) updateKongRouteStatusWithProgrammed(t, ctx, clientNamespaced, kongRoute, routeID, cp.GetKonnectStatus().GetKonnectID(), serviceID) - kongConsumerGroup := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, cp, + kongConsumerGroup := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithAnnotation(metadata.AnnotationKeyPlugins, rateLimitingkongPlugin.Name), ) t.Cleanup(func() { diff --git a/test/envtest/kongpluginbinding_unmanaged_test.go b/test/envtest/kongpluginbinding_unmanaged_test.go index 1689e8d99..294e6cff2 100644 --- a/test/envtest/kongpluginbinding_unmanaged_test.go +++ b/test/envtest/kongpluginbinding_unmanaged_test.go @@ -68,7 +68,9 @@ func TestKongPluginBindingUnmanaged(t *testing.T) { ) defer createCall.Unset() - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp) + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) updateKongServiceStatusWithProgrammed(t, ctx, clientNamespaced, kongService, serviceID, cp.GetKonnectStatus().GetKonnectID()) kpb := deploy.KongPluginBinding(t, ctx, clientNamespaced, @@ -141,7 +143,10 @@ func TestKongPluginBindingUnmanaged(t *testing.T) { ) defer createCall.Unset() - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp) + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) + updateKongServiceStatusWithProgrammed(t, ctx, clientNamespaced, kongService, serviceID, cp.GetKonnectStatus().GetKonnectID()) kongRoute := deploy.KongRouteAttachedToService(t, ctx, clientNamespaced, kongService) updateKongRouteStatusWithProgrammed(t, ctx, clientNamespaced, kongRoute, routeID, cp.GetKonnectStatus().GetKonnectID(), serviceID) @@ -205,7 +210,10 @@ func TestKongPluginBindingUnmanaged(t *testing.T) { routeID := uuid.NewString() pluginID := uuid.NewString() - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp) + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) + updateKongServiceStatusWithProgrammed(t, ctx, clientNamespaced, kongService, serviceID, cp.GetKonnectStatus().GetKonnectID()) kongRoute := deploy.KongRouteAttachedToService(t, ctx, clientNamespaced, kongService) updateKongRouteStatusWithProgrammed(t, ctx, clientNamespaced, kongRoute, routeID, cp.GetKonnectStatus().GetKonnectID(), serviceID) @@ -287,12 +295,17 @@ func TestKongPluginBindingUnmanaged(t *testing.T) { pluginID := uuid.NewString() username := "test-user" + uuid.NewString() - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp) + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) + t.Cleanup(func() { require.NoError(t, client.IgnoreNotFound(clientNamespaced.Delete(ctx, kongService))) }) updateKongServiceStatusWithProgrammed(t, ctx, clientNamespaced, kongService, serviceID, cp.GetKonnectStatus().GetKonnectID()) - kongConsumer := deploy.KongConsumerAttachedToCP(t, ctx, clientNamespaced, username, cp) + kongConsumer := deploy.KongConsumer(t, ctx, clientNamespaced, username, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) t.Cleanup(func() { require.NoError(t, client.IgnoreNotFound(clientNamespaced.Delete(ctx, kongConsumer))) }) @@ -374,9 +387,14 @@ func TestKongPluginBindingUnmanaged(t *testing.T) { consumerGroupID := uuid.NewString() pluginID := uuid.NewString() - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp) + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) + updateKongServiceStatusWithProgrammed(t, ctx, clientNamespaced, kongService, serviceID, cp.GetKonnectStatus().GetKonnectID()) - kongConsumerGroup := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, cp) + kongConsumerGroup := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) updateKongConsumerGroupStatusWithKonnectID(t, ctx, clientNamespaced, kongConsumerGroup, consumerGroupID, cp.GetKonnectStatus().GetKonnectID()) sdk.PluginSDK.EXPECT(). diff --git a/test/envtest/kongplugincleanupfinalizer_test.go b/test/envtest/kongplugincleanupfinalizer_test.go index 6c5ec4f50..dc3d35768 100644 --- a/test/envtest/kongplugincleanupfinalizer_test.go +++ b/test/envtest/kongplugincleanupfinalizer_test.go @@ -59,7 +59,8 @@ func TestKongPluginFinalizer(t *testing.T) { }) wKongService := setupWatch[configurationv1alpha1.KongServiceList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp, + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithAnnotation(metadata.AnnotationKeyPlugins, rateLimitingkongPlugin.Name), ) @@ -89,7 +90,9 @@ func TestKongPluginFinalizer(t *testing.T) { require.NoError(t, clientNamespaced.Delete(ctx, rateLimitingkongPlugin)) }) - kongService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp) + kongService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) wKongRoute := setupWatch[configurationv1alpha1.KongRouteList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) kongRoute := deploy.KongRouteAttachedToService(t, ctx, clientNamespaced, kongService, deploy.WithAnnotation(metadata.AnnotationKeyPlugins, rateLimitingkongPlugin.Name), @@ -122,7 +125,8 @@ func TestKongPluginFinalizer(t *testing.T) { }) wKongConsumer := setupWatch[configurationv1.KongConsumerList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) - kongConsumer := deploy.KongConsumerAttachedToCP(t, ctx, clientNamespaced, "username-1", cp, + kongConsumer := deploy.KongConsumer(t, ctx, clientNamespaced, "username-1", + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithAnnotation(metadata.AnnotationKeyPlugins, rateLimitingkongPlugin.Name), ) @@ -153,7 +157,8 @@ func TestKongPluginFinalizer(t *testing.T) { }) wKongConsumerGroup := setupWatch[configurationv1beta1.KongConsumerGroupList](t, ctx, clientWithWatch, client.InNamespace(ns.Name)) - kongConsumerGroup := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, cp, + kongConsumerGroup := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithAnnotation(metadata.AnnotationKeyPlugins, rateLimitingkongPlugin.Name), ) diff --git a/test/envtest/konnect_entities_kongcacertificate_test.go b/test/envtest/konnect_entities_kongcacertificate_test.go index fd9b3850e..915dd7489 100644 --- a/test/envtest/konnect_entities_kongcacertificate_test.go +++ b/test/envtest/konnect_entities_kongcacertificate_test.go @@ -2,6 +2,7 @@ package envtest import ( "context" + "fmt" "slices" "testing" @@ -223,4 +224,62 @@ func TestKongCACertificate(t *testing.T) { assert.True(c, factory.SDK.CACertificatesSDK.AssertExpectations(t)) }, waitTime, tickTime) }) + + t.Run("removing referenced CP sets the status conditions properly", func(t *testing.T) { + const ( + id = "abc-12345" + ) + + var tags []string = []string{"tag1"} + + t.Log("Creating KonnectAPIAuthConfiguration and KonnectGatewayControlPlane") + apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) + cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) + + t.Log("Setting up a watch for KongCACertifcate events") + w := setupWatch[configurationv1alpha1.KongCACertificateList](t, ctx, cl, client.InNamespace(ns.Name)) + + t.Log("Setting up SDK expectations on KongCACertifcate creation") + sdk.CACertificatesSDK.EXPECT(). + CreateCaCertificate( + mock.Anything, + cp.GetKonnectID(), + mock.MatchedBy(func(req sdkkonnectcomp.CACertificateInput) bool { + return slices.Contains(req.Tags, "tag1") + }), + ). + Return( + &sdkkonnectops.CreateCaCertificateResponse{ + CACertificate: &sdkkonnectcomp.CACertificate{ + ID: lo.ToPtr(id), + }, + }, + nil, + ) + + created := deploy.KongCACertificateAttachedToCP(t, ctx, clientNamespaced, cp, + deploy.WithKonnectIDControlPlaneRef(cp), + func(obj client.Object) { + cert := obj.(*configurationv1alpha1.KongCACertificate) + cert.Spec.Tags = tags + }, + ) + t.Log("Checking SDK CACertificate operations") + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.True(c, factory.SDK.CACertificatesSDK.AssertExpectations(t)) + }, waitTime, tickTime) + + t.Log("Waiting for object to be programmed and get Konnect ID") + watchFor(t, ctx, w, watch.Modified, conditionProgrammedIsSetToTrue(created, id), + fmt.Sprintf("CACertificate didn't get Programmed status condition or didn't get the correct %s Konnect ID assigned", id)) + + t.Log("Deleting KonnectGatewayControlPlane") + require.NoError(t, clientNamespaced.Delete(ctx, cp)) + + t.Log("Waiting for CACert to be get Programmed and ControlPlaneRefValid conditions with status=False") + watchFor(t, ctx, w, watch.Modified, + conditionsAreSetWhenReferencedControlPlaneIsMissing(created), + "KongCACertificate didn't get Programmed and/or ControlPlaneRefValid status condition set to False", + ) + }) } diff --git a/test/envtest/konnect_entities_kongcertificate_test.go b/test/envtest/konnect_entities_kongcertificate_test.go index 847fc39cb..882454776 100644 --- a/test/envtest/konnect_entities_kongcertificate_test.go +++ b/test/envtest/konnect_entities_kongcertificate_test.go @@ -2,6 +2,7 @@ package envtest import ( "context" + "fmt" "slices" "testing" @@ -228,4 +229,62 @@ func TestKongCertificate(t *testing.T) { assert.True(c, factory.SDK.CertificatesSDK.AssertExpectations(t)) }, waitTime, tickTime) }) + + t.Run("removing referenced CP sets the status conditions properly", func(t *testing.T) { + const ( + id = "abc-12345" + ) + + var tags []string = []string{"tag1"} + + t.Log("Creating KonnectAPIAuthConfiguration and KonnectGatewayControlPlane") + apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) + cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) + + t.Log("Setting up a watch for KongCertifcate events") + w := setupWatch[configurationv1alpha1.KongCertificateList](t, ctx, cl, client.InNamespace(ns.Name)) + + t.Log("Setting up SDK expectations on KongCertifcate creation") + sdk.CertificatesSDK.EXPECT(). + CreateCertificate( + mock.Anything, + cp.GetKonnectID(), + mock.MatchedBy(func(req sdkkonnectcomp.CertificateInput) bool { + return slices.Contains(req.Tags, "tag1") + }), + ). + Return( + &sdkkonnectops.CreateCertificateResponse{ + Certificate: &sdkkonnectcomp.Certificate{ + ID: lo.ToPtr(id), + }, + }, + nil, + ) + + created := deploy.KongCertificateAttachedToCP(t, ctx, clientNamespaced, cp, + deploy.WithKonnectIDControlPlaneRef(cp), + func(obj client.Object) { + cert := obj.(*configurationv1alpha1.KongCertificate) + cert.Spec.Tags = tags + }, + ) + t.Log("Checking SDK Certificate operations") + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.True(c, factory.SDK.CACertificatesSDK.AssertExpectations(t)) + }, waitTime, tickTime) + + t.Log("Waiting for object to be programmed and get Konnect ID") + watchFor(t, ctx, w, watch.Modified, conditionProgrammedIsSetToTrue(created, id), + fmt.Sprintf("Certificate didn't get Programmed status condition or didn't get the correct %s Konnect ID assigned", id)) + + t.Log("Deleting KonnectGatewayControlPlane") + require.NoError(t, clientNamespaced.Delete(ctx, cp)) + + t.Log("Waiting for CACert to be get Programmed and ControlPlaneRefValid conditions with status=False") + watchFor(t, ctx, w, watch.Modified, + conditionsAreSetWhenReferencedControlPlaneIsMissing(created), + "KongCACertificate didn't get Programmed and/or ControlPlaneRefValid status condition set to False", + ) + }) } diff --git a/test/envtest/konnect_entities_kongconsumer_test.go b/test/envtest/konnect_entities_kongconsumer_test.go index 20b616595..fbe97898f 100644 --- a/test/envtest/konnect_entities_kongconsumer_test.go +++ b/test/envtest/konnect_entities_kongconsumer_test.go @@ -100,7 +100,9 @@ func TestKongConsumer(t *testing.T) { }).Return(&sdkkonnectops.ListConsumerGroupsForConsumerResponse{}, nil) t.Log("Creating KongConsumer") - createdConsumer := deploy.KongConsumerAttachedToCP(t, ctx, clientNamespaced, username, cp) + createdConsumer := deploy.KongConsumer(t, ctx, clientNamespaced, username, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) t.Log("Waiting for KongConsumer to be programmed") watchFor(t, ctx, cWatch, watch.Modified, func(c *configurationv1.KongConsumer) bool { @@ -221,7 +223,8 @@ func TestKongConsumer(t *testing.T) { }).Return(&sdkkonnectops.AddConsumerToGroupResponse{}, nil) t.Log("Creating KongConsumerGroup") - createdConsumerGroup := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, cp, + createdConsumerGroup := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), func(obj client.Object) { cg := obj.(*configurationv1beta1.KongConsumerGroup) cg.Spec.Name = consumerGroupName @@ -229,7 +232,9 @@ func TestKongConsumer(t *testing.T) { ) t.Log("Creating KongConsumer and patching it with ConsumerGroup") - createdConsumer := deploy.KongConsumerAttachedToCP(t, ctx, clientNamespaced, username, cp) + createdConsumer := deploy.KongConsumer(t, ctx, clientNamespaced, username, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) consumer := createdConsumer.DeepCopy() consumer.ConsumerGroups = []string{createdConsumerGroup.GetName()} require.NoError(t, clientNamespaced.Patch(ctx, consumer, client.MergeFrom(createdConsumer))) @@ -341,7 +346,9 @@ func TestKongConsumer(t *testing.T) { }, nil) t.Log("Creating a KongConsumer") - deploy.KongConsumerAttachedToCP(t, ctx, clientNamespaced, username, cp) + deploy.KongConsumer(t, ctx, clientNamespaced, username, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) t.Log("Watching for KongConsumers to verify the created KongConsumer programmed") watchFor(t, ctx, cWatch, watch.Modified, func(c *configurationv1.KongConsumer) bool { @@ -387,7 +394,10 @@ func TestKongConsumer(t *testing.T) { }).Return(&sdkkonnectops.ListConsumerGroupsForConsumerResponse{}, nil) t.Log("Creating KongConsumer with ControlPlaneRef type=konnectID") - createdConsumer := deploy.KongConsumerAttachedToCP(t, ctx, clientNamespaced, username, cp, deploy.WithKonnectIDControlPlaneRef(cp)) + createdConsumer := deploy.KongConsumer(t, ctx, clientNamespaced, username, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + deploy.WithKonnectIDControlPlaneRef(cp), + ) t.Log("Waiting for KongConsumer to be programmed") watchFor(t, ctx, cWatch, watch.Modified, func(c *configurationv1.KongConsumer) bool { @@ -408,6 +418,71 @@ func TestKongConsumer(t *testing.T) { assert.True(c, factory.SDK.ConsumersSDK.AssertExpectations(t)) }, waitTime, tickTime) }) + + t.Run("removing referenced CP sets the status conditions properly", func(t *testing.T) { + const ( + id = "abc-12345" + name = "name-1" + ) + + t.Log("Creating KonnectAPIAuthConfiguration and KonnectGatewayControlPlane") + apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) + cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) + + t.Log("Setting up a watch for KongConsumer events") + w := setupWatch[configurationv1.KongConsumerList](t, ctx, cl, client.InNamespace(ns.Name)) + + t.Log("Setting up SDK expectations on KongConsumer creation") + sdk.ConsumersSDK.EXPECT(). + CreateConsumer( + mock.Anything, + cp.GetKonnectID(), + mock.MatchedBy(func(req sdkkonnectcomp.ConsumerInput) bool { + return req.Username != nil && *req.Username == name + }), + ). + Return( + &sdkkonnectops.CreateConsumerResponse{ + Consumer: &sdkkonnectcomp.Consumer{ + ID: lo.ToPtr(id), + Username: lo.ToPtr(name), + }, + }, + nil, + ) + + t.Log("Setting up SDK expectation on KongConsumerGroups listing") + sdk.ConsumerGroupSDK.EXPECT(). + ListConsumerGroupsForConsumer(mock.Anything, sdkkonnectops.ListConsumerGroupsForConsumerRequest{ + ConsumerID: id, + ControlPlaneID: cp.GetKonnectStatus().GetKonnectID(), + }).Return(&sdkkonnectops.ListConsumerGroupsForConsumerResponse{}, nil) + + created := deploy.KongConsumer(t, ctx, clientNamespaced, name, + deploy.WithKonnectIDControlPlaneRef(cp), + func(obj client.Object) { + cert := obj.(*configurationv1.KongConsumer) + cert.Username = name + }, + ) + t.Log("Checking SDK Consumer operations") + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.True(c, factory.SDK.ConsumersSDK.AssertExpectations(t)) + }, waitTime, tickTime) + + t.Log("Waiting for object to be programmed and get Konnect ID") + watchFor(t, ctx, w, watch.Modified, conditionProgrammedIsSetToTrue(created, id), + fmt.Sprintf("Consumer didn't get Programmed status condition or didn't get the correct %s Konnect ID assigned", id)) + + t.Log("Deleting KonnectGatewayControlPlane") + require.NoError(t, clientNamespaced.Delete(ctx, cp)) + + t.Log("Waiting for KongConsumer to be get Programmed and ControlPlaneRefValid conditions with status=False") + watchFor(t, ctx, w, watch.Modified, + conditionsAreSetWhenReferencedControlPlaneIsMissing(created), + "KongConsumer didn't get Programmed and/or ControlPlaneRefValid status condition set to False", + ) + }) } func TestKongConsumerSecretCredentials(t *testing.T) { @@ -506,7 +581,8 @@ func TestKongConsumerSecretCredentials(t *testing.T) { ) t.Log("Creating KongConsumer with ControlPlaneRef type=konnectID") - createdConsumer := deploy.KongConsumerAttachedToCP(t, ctx, clientNamespaced, username, cp, deploy.WithKonnectIDControlPlaneRef(cp), + createdConsumer := deploy.KongConsumer(t, ctx, clientNamespaced, username, + deploy.WithKonnectIDControlPlaneRef(cp), func(obj client.Object) { consumer := obj.(*configurationv1.KongConsumer) consumer.Credentials = []string{ diff --git a/test/envtest/konnect_entities_kongconsumergroup_test.go b/test/envtest/konnect_entities_kongconsumergroup_test.go index 80ebade14..3fccb8cf6 100644 --- a/test/envtest/konnect_entities_kongconsumergroup_test.go +++ b/test/envtest/konnect_entities_kongconsumergroup_test.go @@ -2,6 +2,7 @@ package envtest import ( "context" + "fmt" "strings" "testing" @@ -80,7 +81,8 @@ func TestKongConsumerGroup(t *testing.T) { ) t.Log("Creating KongConsumerGroup") - cg := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, cp, + cg := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), func(obj client.Object) { cg := obj.(*configurationv1beta1.KongConsumerGroup) cg.Spec.Name = cgName @@ -182,7 +184,8 @@ func TestKongConsumerGroup(t *testing.T) { ) t.Log("Creating KongConsumerGroup") - deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, cp, + deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), func(obj client.Object) { cg := obj.(*configurationv1beta1.KongConsumerGroup) cg.Spec.Name = cgName @@ -219,7 +222,8 @@ func TestKongConsumerGroup(t *testing.T) { ) t.Log("Creating KongConsumerGroup with ControlPlaneRef type=konnectID") - cg := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, cp, + cg := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), func(obj client.Object) { cg := obj.(*configurationv1beta1.KongConsumerGroup) cg.Spec.Name = cgName @@ -246,4 +250,62 @@ func TestKongConsumerGroup(t *testing.T) { assert.True(c, factory.SDK.ConsumerGroupSDK.AssertExpectations(t)) }, waitTime, tickTime) }) + + t.Run("removing referenced CP sets the status conditions properly", func(t *testing.T) { + const ( + id = "abc-12345" + name = "name-1" + ) + + t.Log("Creating KonnectAPIAuthConfiguration and KonnectGatewayControlPlane") + apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) + cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) + + t.Log("Setting up a watch for KongConsumerGroup events") + w := setupWatch[configurationv1beta1.KongConsumerGroupList](t, ctx, cl, client.InNamespace(ns.Name)) + + t.Log("Setting up SDK expectations on KongConsumerGroup creation") + sdk.ConsumerGroupSDK.EXPECT(). + CreateConsumerGroup( + mock.Anything, + cp.GetKonnectID(), + mock.MatchedBy(func(req sdkkonnectcomp.ConsumerGroupInput) bool { + return req.Name == name + }), + ). + Return( + &sdkkonnectops.CreateConsumerGroupResponse{ + ConsumerGroup: &sdkkonnectcomp.ConsumerGroup{ + ID: lo.ToPtr(id), + Name: name, + }, + }, + nil, + ) + + created := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectIDControlPlaneRef(cp), + func(obj client.Object) { + cg := obj.(*configurationv1beta1.KongConsumerGroup) + cg.Spec.Name = name + }, + ) + t.Log("Checking SDK ConsumerGroup operations") + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.True(c, factory.SDK.ConsumerGroupSDK.AssertExpectations(t)) + }, waitTime, tickTime) + + t.Log("Waiting for object to be programmed and get Konnect ID") + watchFor(t, ctx, w, watch.Modified, conditionProgrammedIsSetToTrue(created, id), + fmt.Sprintf("ConsumerGroup didn't get Programmed status condition or didn't get the correct %s Konnect ID assigned", id)) + + t.Log("Deleting KonnectGatewayControlPlane") + require.NoError(t, clientNamespaced.Delete(ctx, cp)) + + t.Log("Waiting for KongConsumerGroup to be get Programmed and ControlPlaneRefValid conditions with status=False") + watchFor(t, ctx, w, watch.Modified, + conditionsAreSetWhenReferencedControlPlaneIsMissing(created), + "KongConsumerGroup didn't get Programmed and/or ControlPlaneRefValid status condition set to False", + ) + }) } diff --git a/test/envtest/konnect_entities_kongdataplaneclientcertificate_test.go b/test/envtest/konnect_entities_kongdataplaneclientcertificate_test.go index 228b9f062..839c32c94 100644 --- a/test/envtest/konnect_entities_kongdataplaneclientcertificate_test.go +++ b/test/envtest/konnect_entities_kongdataplaneclientcertificate_test.go @@ -2,6 +2,7 @@ package envtest import ( "context" + "fmt" "testing" sdkkonnectcomp "github.com/Kong/sdk-konnect-go/models/components" @@ -69,7 +70,9 @@ func TestKongDataPlaneClientCertificate(t *testing.T) { w := setupWatch[configurationv1alpha1.KongDataPlaneClientCertificateList](t, ctx, cl, client.InNamespace(ns.Name)) t.Log("Creating KongDataPlaneClientCertificate") - createdCert := deploy.KongDataPlaneClientCertificateAttachedToCP(t, ctx, clientNamespaced, cp) + createdCert := deploy.KongDataPlaneClientCertificateAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) t.Log("Waiting for KongDataPlaneClientCertificate to be programmed") watchFor(t, ctx, w, watch.Modified, func(c *configurationv1alpha1.KongDataPlaneClientCertificate) bool { @@ -116,7 +119,7 @@ func TestKongDataPlaneClientCertificate(t *testing.T) { }, nil) t.Log("Creating KongDataPlaneClientCertificate with ControlPlaneRef type=konnectID") - createdCert := deploy.KongDataPlaneClientCertificateAttachedToCP(t, ctx, clientNamespaced, cp, + createdCert := deploy.KongDataPlaneClientCertificateAttachedToCP(t, ctx, clientNamespaced, deploy.WithKonnectIDControlPlaneRef(cp), ) @@ -138,6 +141,57 @@ func TestKongDataPlaneClientCertificate(t *testing.T) { require.EventuallyWithT(t, func(c *assert.CollectT) { assert.True(c, factory.SDK.CACertificatesSDK.AssertExpectations(t)) }, waitTime, tickTime) + }) + + t.Run("removing referenced CP sets the status conditions properly", func(t *testing.T) { + const ( + id = "abc-12345" + ) + + t.Log("Creating KonnectAPIAuthConfiguration and KonnectGatewayControlPlane") + apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) + cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) + + t.Log("Setting up a watch for KongDataPlaneClientCertificate events") + w := setupWatch[configurationv1alpha1.KongDataPlaneClientCertificateList](t, ctx, cl, client.InNamespace(ns.Name)) + + t.Log("Setting up SDK expectations on KongDataPlaneClientCertificate creation") + sdk.DataPlaneCertificatesSDK.EXPECT(). + CreateDataplaneCertificate( + mock.Anything, + cp.GetKonnectID(), + mock.Anything, + ). + Return( + &sdkkonnectops.CreateDataplaneCertificateResponse{ + DataPlaneClientCertificate: &sdkkonnectcomp.DataPlaneClientCertificate{ + Item: &sdkkonnectcomp.DataPlaneClientCertificateItem{ + ID: lo.ToPtr(id), + }, + }, + }, + nil, + ) + created := deploy.KongDataPlaneClientCertificateAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectIDControlPlaneRef(cp), + ) + t.Log("Checking SDK DataPlaneClientCertificate operations") + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.True(c, factory.SDK.DataPlaneCertificatesSDK.AssertExpectations(t)) + }, waitTime, tickTime) + + t.Log("Waiting for object to be programmed and get Konnect ID") + watchFor(t, ctx, w, watch.Modified, conditionProgrammedIsSetToTrue(created, id), + fmt.Sprintf("DataPlaneClientCertificate didn't get Programmed status condition or didn't get the correct %s Konnect ID assigned", id)) + + t.Log("Deleting KonnectGatewayControlPlane") + require.NoError(t, clientNamespaced.Delete(ctx, cp)) + + t.Log("Waiting for DataPlaneClientCertificate to be get Programmed and ControlPlaneRefValid conditions with status=False") + watchFor(t, ctx, w, watch.Modified, + conditionsAreSetWhenReferencedControlPlaneIsMissing(created), + "KongDataPlaneClientCertificate didn't get Programmed and/or ControlPlaneRefValid status condition set to False", + ) }) } diff --git a/test/envtest/konnect_entities_kongkey_test.go b/test/envtest/konnect_entities_kongkey_test.go index 839d1455f..e9e44c3dc 100644 --- a/test/envtest/konnect_entities_kongkey_test.go +++ b/test/envtest/konnect_entities_kongkey_test.go @@ -2,6 +2,8 @@ package envtest import ( "context" + "fmt" + "slices" "strings" "testing" @@ -77,7 +79,9 @@ func TestKongKey(t *testing.T) { t.Run("without KongKeySet", func(t *testing.T) { t.Log("Creating KongKey") - createdKey := deploy.KongKeyAttachedToCP(t, ctx, clientNamespaced, keyKid, keyName, cp) + createdKey := deploy.KongKey(t, ctx, clientNamespaced, keyKid, keyName, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) t.Log("Waiting for KongKey to be programmed") watchFor(t, ctx, w, watch.Modified, func(c *configurationv1alpha1.KongKey) bool { @@ -159,7 +163,9 @@ func TestKongKey(t *testing.T) { }, nil) t.Log("Creating KongKey") - createdKey := deploy.KongKeyAttachedToCP(t, ctx, clientNamespaced, keyKid, keyName, cp) + createdKey := deploy.KongKey(t, ctx, clientNamespaced, keyKid, keyName, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) t.Log("Waiting for KongKey to be programmed") watchFor(t, ctx, w, watch.Modified, func(k *configurationv1alpha1.KongKey) bool { @@ -180,15 +186,18 @@ func TestKongKey(t *testing.T) { t.Run("with KongKeySet", func(t *testing.T) { t.Log("Creating KongKey") - withKeySetRef := func(key *configurationv1alpha1.KongKey) { - key.Spec.KeySetRef = &configurationv1alpha1.KeySetRef{ - Type: configurationv1alpha1.KeySetRefNamespacedRef, - NamespacedRef: lo.ToPtr(configurationv1alpha1.KeySetNamespacedRef{ - Name: keySetName, - }), - } - } - createdKey := deploy.KongKeyAttachedToCP(t, ctx, clientNamespaced, keyKid, keyName, cp, withKeySetRef) + createdKey := deploy.KongKey(t, ctx, clientNamespaced, keyKid, keyName, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + func(obj client.Object) { + key := obj.(*configurationv1alpha1.KongKey) + key.Spec.KeySetRef = &configurationv1alpha1.KeySetRef{ + Type: configurationv1alpha1.KeySetRefNamespacedRef, + NamespacedRef: lo.ToPtr(configurationv1alpha1.KeySetNamespacedRef{ + Name: keySetName, + }), + } + }, + ) t.Log("Waiting for KeySetRefValid condition to be false") watchFor(t, ctx, w, watch.Modified, func(c *configurationv1alpha1.KongKey) bool { @@ -215,7 +224,9 @@ func TestKongKey(t *testing.T) { }, nil) t.Log("Creating KongKeySet") - keySet := deploy.KongKeySetAttachedToCP(t, ctx, clientNamespaced, keySetName, cp) + keySet := deploy.KongKeySet(t, ctx, clientNamespaced, keySetName, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) updateKongKeySetStatusWithProgrammed(t, ctx, clientNamespaced, keySet, keySetID, cp.GetKonnectStatus().GetKonnectID()) t.Log("Waiting for KongKey to be programmed and associated with KongKeySet") @@ -233,9 +244,12 @@ func TestKongKey(t *testing.T) { }) keySetIDPopulated := c.Status.Konnect != nil && c.Status.Konnect.KeySetID != "" exactlyOneOwnerReference := len(c.GetOwnerReferences()) == 1 - hasOwnerRefToKeySet := c.GetOwnerReferences()[0].Name == keySet.GetName() + if !exactlyOneOwnerReference { + return false + } - return programmed && associated && keySetIDPopulated && exactlyOneOwnerReference && hasOwnerRefToKeySet + hasOwnerRefToKeySet := c.GetOwnerReferences()[0].Name == keySet.GetName() + return programmed && associated && keySetIDPopulated && hasOwnerRefToKeySet }, "KongKey's Programmed and KeySetRefValid conditions should be true eventually") t.Log("Waiting for KongKey to be created in the SDK") @@ -285,8 +299,8 @@ func TestKongKey(t *testing.T) { }, nil) t.Log("Creating KongKey with ControlPlaneRef type=konnectID") - createdKey := deploy.KongKeyAttachedToCP(t, ctx, clientNamespaced, keyKid, keyName, cp, - func(k *configurationv1alpha1.KongKey) { deploy.WithKonnectIDControlPlaneRef(cp)(k) }, + createdKey := deploy.KongKey(t, ctx, clientNamespaced, keyKid, keyName, + deploy.WithKonnectIDControlPlaneRef(cp), ) t.Log("Waiting for KongKey to be programmed") @@ -308,4 +322,61 @@ func TestKongKey(t *testing.T) { assert.True(c, factory.SDK.KeysSDK.AssertExpectations(t)) }, waitTime, tickTime) }) + + t.Run("removing referenced CP sets the status conditions properly", func(t *testing.T) { + const ( + id = "abc-12345" + ) + + t.Log("Creating KonnectAPIAuthConfiguration and KonnectGatewayControlPlane") + apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) + cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) + + t.Log("Setting up a watch for KongKey events") + w := setupWatch[configurationv1alpha1.KongKeyList](t, ctx, cl, client.InNamespace(ns.Name)) + + t.Log("Setting up SDK expectations on KongKey creation") + sdk.KeysSDK.EXPECT(). + CreateKey( + mock.Anything, + cp.GetKonnectID(), + mock.MatchedBy(func(req sdkkonnectcomp.KeyInput) bool { + return slices.Contains(req.Tags, "test-1") + }), + ). + Return( + &sdkkonnectops.CreateKeyResponse{ + Key: &sdkkonnectcomp.Key{ + ID: lo.ToPtr(id), + Tags: []string{"test-1"}, + }, + }, + nil, + ) + + created := deploy.KongKey(t, ctx, clientNamespaced, "key-kid", "key-name", + deploy.WithKonnectIDControlPlaneRef(cp), + func(obj client.Object) { + cg := obj.(*configurationv1alpha1.KongKey) + cg.Spec.Tags = append(cg.Spec.Tags, "test-1") + }, + ) + t.Log("Checking SDK Key operations") + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.True(c, factory.SDK.KeysSDK.AssertExpectations(t)) + }, waitTime, tickTime) + + t.Log("Waiting for object to be programmed and get Konnect ID") + watchFor(t, ctx, w, watch.Modified, conditionProgrammedIsSetToTrue(created, id), + fmt.Sprintf("Key didn't get Programmed status condition or didn't get the correct %s Konnect ID assigned", id)) + + t.Log("Deleting KonnectGatewayControlPlane") + require.NoError(t, clientNamespaced.Delete(ctx, cp)) + + t.Log("Waiting for KongKey to be get Programmed and ControlPlaneRefValid conditions with status=False") + watchFor(t, ctx, w, watch.Modified, + conditionsAreSetWhenReferencedControlPlaneIsMissing(created), + "KongKey didn't get Programmed and/or ControlPlaneRefValid status condition set to False", + ) + }) } diff --git a/test/envtest/konnect_entities_kongkeyset_test.go b/test/envtest/konnect_entities_kongkeyset_test.go index a959906a3..f4635515c 100644 --- a/test/envtest/konnect_entities_kongkeyset_test.go +++ b/test/envtest/konnect_entities_kongkeyset_test.go @@ -2,6 +2,8 @@ package envtest import ( "context" + "fmt" + "slices" "strings" "testing" @@ -73,7 +75,9 @@ func TestKongKeySet(t *testing.T) { w := setupWatch[configurationv1alpha1.KongKeySetList](t, ctx, cl, client.InNamespace(ns.Name)) t.Log("Creating KongKeySet") - createdKeySet := deploy.KongKeySetAttachedToCP(t, ctx, clientNamespaced, keySetName, cp) + createdKeySet := deploy.KongKeySet(t, ctx, clientNamespaced, keySetName, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) t.Log("Waiting for KongKeySet to be programmed") watchFor(t, ctx, w, watch.Modified, func(c *configurationv1alpha1.KongKeySet) bool { @@ -151,7 +155,9 @@ func TestKongKeySet(t *testing.T) { }, nil) t.Log("Creating a KeySet") - deploy.KongKeySetAttachedToCP(t, ctx, clientNamespaced, keySetName, cp) + deploy.KongKeySet(t, ctx, clientNamespaced, keySetName, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) t.Log("Watching for KeySet to verify the created KeySet programmed") watchFor(t, ctx, w, watch.Modified, func(c *configurationv1alpha1.KongKeySet) bool { return c.GetKonnectID() == keySetID && k8sutils.IsProgrammed(c) @@ -179,7 +185,7 @@ func TestKongKeySet(t *testing.T) { w := setupWatch[configurationv1alpha1.KongKeySetList](t, ctx, cl, client.InNamespace(ns.Name)) t.Log("Creating KongKeySet with ControlPlaneRef type=konnectID") - createdKeySet := deploy.KongKeySetAttachedToCP(t, ctx, clientNamespaced, keySetName, cp, + createdKeySet := deploy.KongKeySet(t, ctx, clientNamespaced, keySetName, deploy.WithKonnectIDControlPlaneRef(cp), ) @@ -202,4 +208,61 @@ func TestKongKeySet(t *testing.T) { assert.True(c, factory.SDK.KeySetsSDK.AssertExpectations(t)) }, waitTime, tickTime) }) + + t.Run("removing referenced CP sets the status conditions properly", func(t *testing.T) { + const ( + id = "abc-12345" + ) + + t.Log("Creating KonnectAPIAuthConfiguration and KonnectGatewayControlPlane") + apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) + cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) + + t.Log("Setting up a watch for KongKeySet events") + w := setupWatch[configurationv1alpha1.KongKeySetList](t, ctx, cl, client.InNamespace(ns.Name)) + + t.Log("Setting up SDK expectations on KongKeySet creation") + sdk.KeySetsSDK.EXPECT(). + CreateKeySet( + mock.Anything, + cp.GetKonnectID(), + mock.MatchedBy(func(req sdkkonnectcomp.KeySetInput) bool { + return slices.Contains(req.Tags, "test-1") + }), + ). + Return( + &sdkkonnectops.CreateKeySetResponse{ + KeySet: &sdkkonnectcomp.KeySet{ + ID: lo.ToPtr(id), + Tags: []string{"test-1"}, + }, + }, + nil, + ) + + created := deploy.KongKeySet(t, ctx, clientNamespaced, "keyset-1", + deploy.WithKonnectIDControlPlaneRef(cp), + func(obj client.Object) { + cg := obj.(*configurationv1alpha1.KongKeySet) + cg.Spec.Tags = append(cg.Spec.Tags, "test-1") + }, + ) + t.Log("Checking SDK Key operations") + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.True(c, factory.SDK.KeysSDK.AssertExpectations(t)) + }, waitTime, tickTime) + + t.Log("Waiting for object to be programmed and get Konnect ID") + watchFor(t, ctx, w, watch.Modified, conditionProgrammedIsSetToTrue(created, id), + fmt.Sprintf("Key didn't get Programmed status condition or didn't get the correct %s Konnect ID assigned", id)) + + t.Log("Deleting KonnectGatewayControlPlane") + require.NoError(t, clientNamespaced.Delete(ctx, cp)) + + t.Log("Waiting for KongKeySet to be get Programmed and ControlPlaneRefValid conditions with status=False") + watchFor(t, ctx, w, watch.Modified, + conditionsAreSetWhenReferencedControlPlaneIsMissing(created), + "KongKeySet didn't get Programmed and/or ControlPlaneRefValid status condition set to False", + ) + }) } diff --git a/test/envtest/konnect_entities_kongroute_test.go b/test/envtest/konnect_entities_kongroute_test.go index 8bba735e2..d472c5a4b 100644 --- a/test/envtest/konnect_entities_kongroute_test.go +++ b/test/envtest/konnect_entities_kongroute_test.go @@ -50,7 +50,9 @@ func TestKongRoute(t *testing.T) { t.Log("Creating KonnectAPIAuthConfiguration and KonnectGatewayControlPlane") apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) - svc := deploy.KongServiceAttachedToCPWithID(t, ctx, clientNamespaced, cp) + svc := deploy.KongServiceWithID(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) t.Run("adding, patching and deleting KongRoute", func(t *testing.T) { const routeID = "route-12345" diff --git a/test/envtest/konnect_entities_kongservice_test.go b/test/envtest/konnect_entities_kongservice_test.go index bb95eb072..c8cc4bae4 100644 --- a/test/envtest/konnect_entities_kongservice_test.go +++ b/test/envtest/konnect_entities_kongservice_test.go @@ -2,6 +2,7 @@ package envtest import ( "context" + "fmt" "testing" sdkkonnectcomp "github.com/Kong/sdk-konnect-go/models/components" @@ -61,7 +62,9 @@ func TestKongService(t *testing.T) { ) t.Log("Creating a KongUpstream and setting it to programmed") - upstream := deploy.KongUpstreamAttachedToCP(t, ctx, clientNamespaced, cp) + upstream := deploy.KongUpstream(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) updateKongUpstreamStatusWithProgrammed(t, ctx, clientNamespaced, upstream, upstreamID, cp.GetKonnectID()) t.Log("Setting up a watch for KongService events") @@ -86,7 +89,8 @@ func TestKongService(t *testing.T) { ) t.Log("Creating a KongService") - createdService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp, + createdService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), func(obj client.Object) { s := obj.(*configurationv1alpha1.KongService) s.Spec.KongServiceAPISpec.Host = host @@ -155,7 +159,9 @@ func TestKongService(t *testing.T) { ) t.Log("Creating a KongUpstream and setting it to programmed") - upstream := deploy.KongUpstreamAttachedToCP(t, ctx, clientNamespaced, cp) + upstream := deploy.KongUpstream(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) updateKongUpstreamStatusWithProgrammed(t, ctx, clientNamespaced, upstream, upstreamID, cp.GetKonnectID()) t.Log("Setting up a watch for KongService events") @@ -180,7 +186,8 @@ func TestKongService(t *testing.T) { ) t.Log("Creating a KongService with ControlPlaneRef type=konnectID") - createdService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp, + createdService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), func(obj client.Object) { s := obj.(*configurationv1alpha1.KongService) s.Spec.KongServiceAPISpec.Host = host @@ -216,7 +223,9 @@ func TestKongService(t *testing.T) { deploy.KonnectGatewayControlPlaneType(sdkkonnectcomp.CreateControlPlaneRequestClusterTypeClusterTypeK8SIngressController), ) t.Log("Creating a KongUpstream and setting it to programmed") - upstream := deploy.KongUpstreamAttachedToCP(t, ctx, clientNamespaced, cp) + upstream := deploy.KongUpstream(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) updateKongUpstreamStatusWithProgrammed(t, ctx, clientNamespaced, upstream, upstreamID, cp.GetKonnectID()) t.Log("Setting up a watch for KongService events") @@ -249,7 +258,8 @@ func TestKongService(t *testing.T) { ) t.Log("Creating a KongService with ControlPlaneRef type=konnectNamespacedRef") - createdService := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp, + createdService := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), func(obj client.Object) { s := obj.(*configurationv1alpha1.KongService) s.Spec.KongServiceAPISpec.Host = host @@ -278,4 +288,62 @@ func TestKongService(t *testing.T) { return c.Status == metav1.ConditionFalse && c.Reason == "FailedToCreate" }, "KongService should get the Programmed condition set to status=False due to using invalid (KIC) ControlPlaneRef") }) + + t.Run("removing referenced CP sets the status conditions properly", func(t *testing.T) { + const ( + id = "service-12345" + host = "example.com" + port = int64(8081) + ) + + t.Log("Creating KonnectAPIAuthConfiguration and KonnectGatewayControlPlane") + apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) + cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) + + t.Log("Setting up a watch for KongService events") + w := setupWatch[configurationv1alpha1.KongServiceList](t, ctx, cl, client.InNamespace(ns.Name)) + + t.Log("Setting up SDK expectations on Service creation") + sdk.ServicesSDK.EXPECT(). + CreateService( + mock.Anything, + cp.GetKonnectID(), + mock.MatchedBy(func(req sdkkonnectcomp.ServiceInput) bool { + return req.Host == host + }), + ). + Return( + &sdkkonnectops.CreateServiceResponse{ + Service: &sdkkonnectcomp.Service{ + ID: lo.ToPtr(id), + }, + }, + nil, + ) + + t.Log("Creating a KongService with ControlPlaneRef type=konnectID") + created := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectIDControlPlaneRef(cp), + func(obj client.Object) { + s := obj.(*configurationv1alpha1.KongService) + s.Spec.KongServiceAPISpec.Host = host + }, + ) + t.Log("Checking SDK KongService operations") + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.True(c, factory.SDK.ServicesSDK.AssertExpectations(t)) + }, waitTime, tickTime) + + t.Log("Waiting for object to be programmed and get Konnect ID") + watchFor(t, ctx, w, watch.Modified, conditionProgrammedIsSetToTrue(created, id), + fmt.Sprintf("KongService didn't get Programmed status condition or didn't get the correct %s Konnect ID assigned", id)) + + t.Log("Deleting KonnectGatewayControlPlane") + require.NoError(t, clientNamespaced.Delete(ctx, cp)) + + t.Log("Waiting for Service to be get Programmed and ControlPlaneRefValid conditions with status=False") + watchFor(t, ctx, w, watch.Modified, + conditionsAreSetWhenReferencedControlPlaneIsMissing(created), + "KongService didn't get Programmed and/or ControlPlaneRefValid status condition set to False") + }) } diff --git a/test/envtest/konnect_entities_kongtarget_test.go b/test/envtest/konnect_entities_kongtarget_test.go index 019e26202..45914a34c 100644 --- a/test/envtest/konnect_entities_kongtarget_test.go +++ b/test/envtest/konnect_entities_kongtarget_test.go @@ -59,7 +59,9 @@ func TestKongTarget(t *testing.T) { ) t.Log("Creating a KongUpstream and setting it to programmed") - upstream := deploy.KongUpstreamAttachedToCP(t, ctx, clientNamespaced, cp) + upstream := deploy.KongUpstream(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), + ) updateKongUpstreamStatusWithProgrammed(t, ctx, clientNamespaced, upstream, upstreamID, cp.GetKonnectID()) t.Log("Setting up a watch for KongTarget events") diff --git a/test/envtest/konnect_entities_kongupstream_test.go b/test/envtest/konnect_entities_kongupstream_test.go index 8d20f92e1..c8dcc3367 100644 --- a/test/envtest/konnect_entities_kongupstream_test.go +++ b/test/envtest/konnect_entities_kongupstream_test.go @@ -2,6 +2,7 @@ package envtest import ( "context" + "fmt" "testing" sdkkonnectcomp "github.com/Kong/sdk-konnect-go/models/components" @@ -12,6 +13,7 @@ import ( "github.com/stretchr/testify/require" k8serrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/watch" + "k8s.io/utils/strings/slices" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" @@ -75,7 +77,8 @@ func TestKongUpstream(t *testing.T) { ) t.Log("Creating a KongUpstream") - createdUpstream := deploy.KongUpstreamAttachedToCP(t, ctx, clientNamespaced, cp, + createdUpstream := deploy.KongUpstream(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), func(obj client.Object) { s := obj.(*configurationv1alpha1.KongUpstream) s.Spec.KongUpstreamAPISpec.Algorithm = sdkkonnectcomp.UpstreamAlgorithmRoundRobin.ToPointer() @@ -140,7 +143,6 @@ func TestKongUpstream(t *testing.T) { }) t.Run("should handle konnectID control plane reference", func(t *testing.T) { - const upstreamID = "upstream-12345" t.Log("Setting up SDK expectations on Upstream creation") @@ -162,12 +164,12 @@ func TestKongUpstream(t *testing.T) { ) t.Log("Creating a KongUpstream with ControlPlaneRef type=konnectID") - createdUpstream := deploy.KongUpstreamAttachedToCP(t, ctx, clientNamespaced, cp, + createdUpstream := deploy.KongUpstream(t, ctx, clientNamespaced, + deploy.WithKonnectIDControlPlaneRef(cp), func(obj client.Object) { s := obj.(*configurationv1alpha1.KongUpstream) s.Spec.KongUpstreamAPISpec.Algorithm = sdkkonnectcomp.UpstreamAlgorithmRoundRobin.ToPointer() }, - deploy.WithKonnectIDControlPlaneRef(cp), ) t.Log("Waiting for Upstream to be programmed and get Konnect ID") @@ -186,4 +188,60 @@ func TestKongUpstream(t *testing.T) { assert.True(c, factory.SDK.UpstreamsSDK.AssertExpectations(t)) }, waitTime, tickTime) }) + + t.Run("removing referenced CP sets the status conditions properly", func(t *testing.T) { + const ( + id = "abc-12345" + ) + + t.Log("Creating KonnectAPIAuthConfiguration and KonnectGatewayControlPlane") + apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) + cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) + + t.Log("Setting up a watch for KongUpstream events") + w := setupWatch[configurationv1alpha1.KongUpstreamList](t, ctx, cl, client.InNamespace(ns.Name)) + + t.Log("Setting up SDK expectations on Upstream creation") + sdk.UpstreamsSDK.EXPECT(). + CreateUpstream( + mock.Anything, + cp.GetKonnectID(), + mock.MatchedBy(func(req sdkkonnectcomp.UpstreamInput) bool { + return slices.Contains(req.Tags, "test-1") + }), + ). + Return( + &sdkkonnectops.CreateUpstreamResponse{ + Upstream: &sdkkonnectcomp.Upstream{ + ID: lo.ToPtr(id), + }, + }, + nil, + ) + + t.Log("Creating a KongUpstream with ControlPlaneRef type=konnectID") + created := deploy.KongUpstream(t, ctx, clientNamespaced, + deploy.WithKonnectIDControlPlaneRef(cp), + func(obj client.Object) { + s := obj.(*configurationv1alpha1.KongUpstream) + s.Spec.Tags = append(s.Spec.Tags, "test-1") + }, + ) + t.Log("Checking SDK KongUpstream operations") + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.True(c, factory.SDK.UpstreamsSDK.AssertExpectations(t)) + }, waitTime, tickTime) + + t.Log("Waiting for object to be programmed and get Konnect ID") + watchFor(t, ctx, w, watch.Modified, conditionProgrammedIsSetToTrue(created, id), + fmt.Sprintf("KongUpstream didn't get Programmed status condition or didn't get the correct %s Konnect ID assigned", id)) + + t.Log("Deleting KonnectGatewayControlPlane") + require.NoError(t, clientNamespaced.Delete(ctx, cp)) + + t.Log("Waiting for Service to be get Programmed and ControlPlaneRefValid conditions with status=False") + watchFor(t, ctx, w, watch.Modified, + conditionsAreSetWhenReferencedControlPlaneIsMissing(created), + "KongUpstream didn't get Programmed and/or ControlPlaneRefValid status condition set to False") + }) } diff --git a/test/helpers/deploy/deploy_resources.go b/test/helpers/deploy/deploy_resources.go index bb0348cf9..07135fd20 100644 --- a/test/helpers/deploy/deploy_resources.go +++ b/test/helpers/deploy/deploy_resources.go @@ -64,22 +64,52 @@ func WithTestIDLabel(testID string) func(obj client.Object) { } } +// WithKonnectNamespacedRefControlPlaneRef returns an ObjOption that sets +// the ControlPlaneRef on the object to a namespaced ref. +// +// NOTE: This only works with namespaced resources. Using it with cluster-scoped +// resources requires additional handling ( to only set the namespace when the resource +// is cluster-scoped). +func WithKonnectNamespacedRefControlPlaneRef(cp *konnectv1alpha1.KonnectGatewayControlPlane) ObjOption { + return func(obj client.Object) { + o, ok := obj.(interface { + GetControlPlaneRef() *configurationv1alpha1.ControlPlaneRef + SetControlPlaneRef(*configurationv1alpha1.ControlPlaneRef) + }) + if !ok { + // As it's only used in tests, we can panic here - it will mean test code is incorrect. + panic(fmt.Errorf("%T does not implement GetControlPlaneRef/SetControlPlaneRef method", obj)) + } + + cpRef := &configurationv1alpha1.ControlPlaneRef{ + Type: configurationv1alpha1.ControlPlaneRefKonnectNamespacedRef, + KonnectNamespacedRef: &configurationv1alpha1.KonnectNamespacedRef{ + Name: cp.GetName(), + }, + } + + o.SetControlPlaneRef(cpRef) + } +} + // WithKonnectIDControlPlaneRef returns an ObjOption that sets the ControlPlaneRef on the object to a KonnectID. func WithKonnectIDControlPlaneRef(cp *konnectv1alpha1.KonnectGatewayControlPlane) ObjOption { return func(obj client.Object) { o, ok := obj.(interface { GetControlPlaneRef() *configurationv1alpha1.ControlPlaneRef + SetControlPlaneRef(*configurationv1alpha1.ControlPlaneRef) }) if !ok { // As it's only used in tests, we can panic here - it will mean test code is incorrect. - panic(fmt.Errorf("%T does not implement GetControlPlaneRef method", obj)) + panic(fmt.Errorf("%T does not implement GetControlPlaneRef/SetControlPlaneRef method", obj)) } - objCPRef := o.GetControlPlaneRef() - *objCPRef = configurationv1alpha1.ControlPlaneRef{ - Type: configurationv1alpha1.ControlPlaneRefKonnectID, - KonnectID: lo.ToPtr(cp.GetKonnectStatus().GetKonnectID()), - } + o.SetControlPlaneRef( + &configurationv1alpha1.ControlPlaneRef{ + Type: configurationv1alpha1.ControlPlaneRefKonnectID, + KonnectID: lo.ToPtr(cp.GetKonnectStatus().GetKonnectID()), + }, + ) } } @@ -212,20 +242,19 @@ func KonnectGatewayControlPlaneWithID( return cp } -// KongServiceAttachedToCPWithID deploys a KongService resource and returns the resource. +// KongServiceWithID deploys a KongService resource and returns the resource. // The Status ID and Programmed condition are set on the Service using status Update() call. // It can be useful where the reconciler for KonnectGatewayControlPlane is not started // and hence the status has to be filled manually. -func KongServiceAttachedToCPWithID( +func KongServiceWithID( t *testing.T, ctx context.Context, cl client.Client, - cp *konnectv1alpha1.KonnectGatewayControlPlane, opts ...ObjOption, ) *configurationv1alpha1.KongService { t.Helper() - svc := KongServiceAttachedToCP(t, ctx, cl, cp, opts...) + svc := KongService(t, ctx, cl, opts...) svc.Status.Conditions = []metav1.Condition{ { Type: konnectv1alpha1.KonnectEntityProgrammedConditionType, @@ -240,12 +269,11 @@ func KongServiceAttachedToCPWithID( return svc } -// KongServiceAttachedToCP deploys a KongService resource and returns the resource. -func KongServiceAttachedToCP( +// KongService deploys a KongService resource and returns the resource. +func KongService( t *testing.T, ctx context.Context, cl client.Client, - cp *konnectv1alpha1.KonnectGatewayControlPlane, opts ...ObjOption, ) *configurationv1alpha1.KongService { t.Helper() @@ -261,12 +289,6 @@ func KongServiceAttachedToCP( URL: lo.ToPtr("http://example.com"), Host: "example.com", }, - ControlPlaneRef: &configurationv1alpha1.ControlPlaneRef{ - Type: configurationv1alpha1.ControlPlaneRefKonnectNamespacedRef, - KonnectNamespacedRef: &configurationv1alpha1.KonnectNamespacedRef{ - Name: cp.Name, - }, - }, }, } @@ -582,12 +604,11 @@ func KongCertificateAttachedToCP( return cert } -// KongUpstreamAttachedToCP deploys a KongUpstream resource attached to a Control Plane and returns the resource. -func KongUpstreamAttachedToCP( +// KongUpstream deploys a KongUpstream resource and returns it. +func KongUpstream( t *testing.T, ctx context.Context, cl client.Client, - cp *konnectv1alpha1.KonnectGatewayControlPlane, opts ...ObjOption, ) *configurationv1alpha1.KongUpstream { t.Helper() @@ -596,14 +617,7 @@ func KongUpstreamAttachedToCP( ObjectMeta: metav1.ObjectMeta{ GenerateName: "upstream-", }, - Spec: configurationv1alpha1.KongUpstreamSpec{ - ControlPlaneRef: &configurationv1alpha1.ControlPlaneRef{ - Type: configurationv1alpha1.ControlPlaneRefKonnectNamespacedRef, - KonnectNamespacedRef: &configurationv1alpha1.KonnectNamespacedRef{ - Name: cp.Name, - }, - }, - }, + Spec: configurationv1alpha1.KongUpstreamSpec{}, } for _, opt := range opts { opt(u) @@ -670,13 +684,12 @@ func Secret( return s } -// KongConsumerAttachedToCP deploys a KongConsumer resource attached to a Control Plane and returns the resource. -func KongConsumerAttachedToCP( +// KongConsumer deploys a KongConsumer resource and returns it. +func KongConsumer( t *testing.T, ctx context.Context, cl client.Client, username string, - cp *konnectv1alpha1.KonnectGatewayControlPlane, opts ...ObjOption, ) *configurationv1.KongConsumer { t.Helper() @@ -685,14 +698,6 @@ func KongConsumerAttachedToCP( ObjectMeta: metav1.ObjectMeta{ GenerateName: "consumer-", }, - Spec: configurationv1.KongConsumerSpec{ - ControlPlaneRef: &configurationv1alpha1.ControlPlaneRef{ - Type: configurationv1alpha1.ControlPlaneRefKonnectNamespacedRef, - KonnectNamespacedRef: &configurationv1alpha1.KonnectNamespacedRef{ - Name: cp.Name, - }, - }, - }, Username: username, } for _, opt := range opts { @@ -710,7 +715,6 @@ func KongConsumerGroupAttachedToCP( t *testing.T, ctx context.Context, cl client.Client, - cp *konnectv1alpha1.KonnectGatewayControlPlane, opts ...ObjOption, ) *configurationv1beta1.KongConsumerGroup { t.Helper() @@ -721,12 +725,6 @@ func KongConsumerGroupAttachedToCP( Name: name, }, Spec: configurationv1beta1.KongConsumerGroupSpec{ - ControlPlaneRef: &configurationv1alpha1.ControlPlaneRef{ - Type: configurationv1alpha1.ControlPlaneRefKonnectNamespacedRef, - KonnectNamespacedRef: &configurationv1alpha1.KonnectNamespacedRef{ - Name: cp.Name, - }, - }, Name: name, }, } @@ -783,16 +781,13 @@ func KongVaultAttachedToCP( return vault } -type kongKeyOption func(*configurationv1alpha1.KongKey) - -// KongKeyAttachedToCP deploys a KongKey resource attached to a CP and returns the resource. -func KongKeyAttachedToCP( +// KongKey deploys a KongKey resource and returns the resource. +func KongKey( t *testing.T, ctx context.Context, cl client.Client, kid, name string, - cp *konnectv1alpha1.KonnectGatewayControlPlane, - opts ...kongKeyOption, + opts ...ObjOption, ) *configurationv1alpha1.KongKey { t.Helper() @@ -801,12 +796,6 @@ func KongKeyAttachedToCP( GenerateName: "key-", }, Spec: configurationv1alpha1.KongKeySpec{ - ControlPlaneRef: &configurationv1alpha1.ControlPlaneRef{ - Type: configurationv1alpha1.ControlPlaneRefKonnectNamespacedRef, - KonnectNamespacedRef: &configurationv1alpha1.KonnectNamespacedRef{ - Name: cp.GetName(), - }, - }, KongKeyAPISpec: configurationv1alpha1.KongKeyAPISpec{ KID: kid, Name: lo.ToPtr(name), @@ -868,13 +857,12 @@ func RateLimitingPlugin( return plugin } -// KongKeySetAttachedToCP deploys a KongKeySet resource attached to a CP and returns the resource. -func KongKeySetAttachedToCP( +// KongKeySet deploys a KongKeySet resource and returns the resource. +func KongKeySet( t *testing.T, ctx context.Context, cl client.Client, name string, - cp *konnectv1alpha1.KonnectGatewayControlPlane, opts ...ObjOption, ) *configurationv1alpha1.KongKeySet { t.Helper() @@ -884,12 +872,6 @@ func KongKeySetAttachedToCP( Name: name, }, Spec: configurationv1alpha1.KongKeySetSpec{ - ControlPlaneRef: &configurationv1alpha1.ControlPlaneRef{ - Type: configurationv1alpha1.ControlPlaneRefKonnectNamespacedRef, - KonnectNamespacedRef: &configurationv1alpha1.KonnectNamespacedRef{ - Name: cp.GetName(), - }, - }, KongKeySetAPISpec: configurationv1alpha1.KongKeySetAPISpec{ Name: name, }, @@ -940,12 +922,11 @@ func KongSNIAttachedToCertificate( return sni } -// KongDataPlaneClientCertificateAttachedToCP deploys a KongDataPlaneClientCertificate resource attached to a CP and returns the resource. +// KongDataPlaneClientCertificateAttachedToCP deploys a KongDataPlaneClientCertificate resource and returns the resource. func KongDataPlaneClientCertificateAttachedToCP( t *testing.T, ctx context.Context, cl client.Client, - cp *konnectv1alpha1.KonnectGatewayControlPlane, opts ...ObjOption, ) *configurationv1alpha1.KongDataPlaneClientCertificate { t.Helper() @@ -955,12 +936,6 @@ func KongDataPlaneClientCertificateAttachedToCP( GenerateName: "dp-cert-", }, Spec: configurationv1alpha1.KongDataPlaneClientCertificateSpec{ - ControlPlaneRef: &configurationv1alpha1.ControlPlaneRef{ - Type: configurationv1alpha1.ControlPlaneRefKonnectNamespacedRef, - KonnectNamespacedRef: &configurationv1alpha1.KonnectNamespacedRef{ - Name: cp.GetName(), - }, - }, KongDataPlaneClientCertificateAPISpec: configurationv1alpha1.KongDataPlaneClientCertificateAPISpec{ Cert: TestValidCACertPEM, }, diff --git a/test/integration/test_konnect_entities.go b/test/integration/test_konnect_entities.go index 52e440fa7..411ebfdf8 100644 --- a/test/integration/test_konnect_entities.go +++ b/test/integration/test_konnect_entities.go @@ -65,7 +65,8 @@ func TestKonnectEntities(t *testing.T) { assertKonnectEntityProgrammed(t, cp) }, testutils.ObjectUpdateTimeout, testutils.ObjectUpdateTick) - ks := deploy.KongServiceAttachedToCP(t, ctx, clientNamespaced, cp, + ks := deploy.KongService(t, ctx, clientNamespaced, + deploy.WithKonnectIDControlPlaneRef(cp), deploy.WithTestIDLabel(testID), ) @@ -96,7 +97,8 @@ func TestKonnectEntities(t *testing.T) { assertKonnectEntityProgrammed(t, kr) }, testutils.ObjectUpdateTimeout, testutils.ObjectUpdateTick) - kcg := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, cp, + kcg := deploy.KongConsumerGroupAttachedToCP(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithTestIDLabel(testID), ) @@ -108,7 +110,8 @@ func TestKonnectEntities(t *testing.T) { assertKonnectEntityProgrammed(t, kcg) }, testutils.ObjectUpdateTimeout, testutils.ObjectUpdateTick) - kc := deploy.KongConsumerAttachedToCP(t, ctx, clientNamespaced, "kc-"+testID, cp, + kc := deploy.KongConsumer(t, ctx, clientNamespaced, "kc-"+testID, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithTestIDLabel(testID), func(obj client.Object) { kc := obj.(*configurationv1.KongConsumer) @@ -162,7 +165,8 @@ func TestKonnectEntities(t *testing.T) { assertKonnectEntityProgrammed(t, globalKPB) }, testutils.ObjectUpdateTimeout, testutils.ObjectUpdateTick) - kup := deploy.KongUpstreamAttachedToCP(t, ctx, clientNamespaced, cp, + kup := deploy.KongUpstream(t, ctx, clientNamespaced, + deploy.WithKonnectNamespacedRefControlPlaneRef(cp), deploy.WithTestIDLabel(testID), func(obj client.Object) { kup := obj.(*configurationv1alpha1.KongUpstream)