Skip to content

Commit

Permalink
chore: konnect ops cleanup (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek authored Oct 29, 2024
1 parent 3a4ad19 commit 03d0015
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 14 deletions.
8 changes: 0 additions & 8 deletions controller/konnect/ops/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion controller/konnect/ops/ops_kongcacertificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion controller/konnect/ops/ops_kongcertificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion controller/konnect/ops/ops_kongconsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion controller/konnect/ops/ops_kongkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion controller/konnect/ops/ops_kongkeyset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 03d0015

Please sign in to comment.