From 03d001594a501bc672f56fffebcf0c67b85a86a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Tue, 29 Oct 2024 14:34:45 +0100 Subject: [PATCH] chore: konnect ops cleanup (#826) --- controller/konnect/ops/ops.go | 8 -------- controller/konnect/ops/ops_kongcacertificate.go | 2 +- controller/konnect/ops/ops_kongcertificate.go | 2 +- controller/konnect/ops/ops_kongconsumer.go | 1 - .../konnect/ops/ops_kongdataplaneclientcertificate.go | 2 +- controller/konnect/ops/ops_kongkey.go | 2 +- controller/konnect/ops/ops_kongkeyset.go | 2 +- 7 files changed, 5 insertions(+), 14 deletions(-) diff --git a/controller/konnect/ops/ops.go b/controller/konnect/ops/ops.go index a3bce6be..59bcf49a 100644 --- a/controller/konnect/ops/ops.go +++ b/controller/konnect/ops/ops.go @@ -25,12 +25,6 @@ import ( konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1" ) -// Response is the interface for the response from the Konnect API. -type Response interface { - GetContentType() string - GetStatusCode() int -} - // Op is the type for the operation type of a Konnect entity. type Op string @@ -323,8 +317,6 @@ func Update[ case *konnectv1alpha1.KonnectGatewayControlPlane: err = updateControlPlane(ctx, sdk.GetControlPlaneSDK(), sdk.GetControlPlaneGroupSDK(), cl, ent) case *configurationv1alpha1.KongService: - // TODO: modify the create* operation wrappers to not set Programmed conditions and return - // a KonnectEntityCreatedButRelationsFailedError if the entity was created but its relations assignment failed. err = updateService(ctx, sdk.GetServicesSDK(), ent) case *configurationv1alpha1.KongRoute: err = updateRoute(ctx, sdk.GetRoutesSDK(), ent) diff --git a/controller/konnect/ops/ops_kongcacertificate.go b/controller/konnect/ops/ops_kongcacertificate.go index 88a1bedb..9d8e3b19 100644 --- a/controller/konnect/ops/ops_kongcacertificate.go +++ b/controller/konnect/ops/ops_kongcacertificate.go @@ -14,7 +14,7 @@ import ( ) // createCACertificate creates a KongCACertificate in Konnect. -// It sets the KonnectID and the Programmed condition in the KongCACertificate status. +// It sets the KonnectID the KongCACertificate status. func createCACertificate( ctx context.Context, sdk sdkops.CACertificatesSDK, diff --git a/controller/konnect/ops/ops_kongcertificate.go b/controller/konnect/ops/ops_kongcertificate.go index bc46a072..359d4d2d 100644 --- a/controller/konnect/ops/ops_kongcertificate.go +++ b/controller/konnect/ops/ops_kongcertificate.go @@ -14,7 +14,7 @@ import ( ) // createCertificate creates a KongCertificate in Konnect. -// It sets the KonnectID and the Programmed condition in the KongCertificate status. +// It sets the KonnectID in the KongCertificate status. func createCertificate( ctx context.Context, sdk sdkops.CertificatesSDK, diff --git a/controller/konnect/ops/ops_kongconsumer.go b/controller/konnect/ops/ops_kongconsumer.go index 9ea92f62..cc8a5eba 100644 --- a/controller/konnect/ops/ops_kongconsumer.go +++ b/controller/konnect/ops/ops_kongconsumer.go @@ -105,7 +105,6 @@ func updateConsumer( // handleConsumerGroupAssignments resolves ConsumerGroup references of a KongConsumer, reconciles them with Konnect, and // updates the Consumer conditions accordingly: -// - sets Programmed to False if any operation fails // - sets KongConsumerGroupRefsValid to False if any of the ConsumerGroup references are invalid // - sets KongConsumerGroupRefsValid to True if all ConsumerGroup references are valid // It returns an error if any of the operations fail (fetching KongConsumers from cache, fetching the actual Konnect diff --git a/controller/konnect/ops/ops_kongdataplaneclientcertificate.go b/controller/konnect/ops/ops_kongdataplaneclientcertificate.go index 02a68027..50524e92 100644 --- a/controller/konnect/ops/ops_kongdataplaneclientcertificate.go +++ b/controller/konnect/ops/ops_kongdataplaneclientcertificate.go @@ -11,7 +11,7 @@ import ( ) // createKongDataPlaneClientCertificate creates a KongDataPlaneClientCertificate in Konnect. -// It sets the KonnectID and the Programmed condition in the KongDataPlaneClientCertificate status. +// It sets the KonnectID in the KongDataPlaneClientCertificate status. func createKongDataPlaneClientCertificate( ctx context.Context, sdk sdkops.DataPlaneClientCertificatesSDK, diff --git a/controller/konnect/ops/ops_kongkey.go b/controller/konnect/ops/ops_kongkey.go index 665a70d1..33f1136e 100644 --- a/controller/konnect/ops/ops_kongkey.go +++ b/controller/konnect/ops/ops_kongkey.go @@ -14,7 +14,7 @@ import ( ) // createKey creates a KongKey in Konnect. -// It sets the KonnectID and the Programmed condition in the KongKey status. +// It sets the KonnectID in the KongKey status. func createKey( ctx context.Context, sdk sdkops.KeysSDK, diff --git a/controller/konnect/ops/ops_kongkeyset.go b/controller/konnect/ops/ops_kongkeyset.go index 94935add..0d9b30e8 100644 --- a/controller/konnect/ops/ops_kongkeyset.go +++ b/controller/konnect/ops/ops_kongkeyset.go @@ -14,7 +14,7 @@ import ( ) // createKeySet creates a KongKeySet in Konnect. -// It sets the KonnectID and the Programmed condition in the KongKeySet status. +// It sets the KonnectID in the KongKeySet status. func createKeySet( ctx context.Context, sdk sdkops.KeySetsSDK,