Skip to content

Commit

Permalink
chore: make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Oct 24, 2024
1 parent 4642341 commit ff10d9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions controller/konnect/ops/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ func Create[
func Delete[
T constraints.SupportedKonnectEntityType,
TEnt constraints.EntityType[T],
](ctx context.Context, sdk sdkops.SDKWrapper, cl client.Client, e TEnt) error {
ent := TEnt(e)
](ctx context.Context, sdk sdkops.SDKWrapper, cl client.Client, ent TEnt) error {
if ent.GetKonnectStatus().GetKonnectID() == "" {
cond, ok := k8sutils.GetCondition(konnectv1alpha1.KonnectEntityProgrammedConditionType, ent)
if ok && cond.Status == metav1.ConditionTrue {
Expand All @@ -196,7 +195,7 @@ func Delete[
err error
start = time.Now()
)
switch ent := any(e).(type) {
switch ent := any(ent).(type) {
case *konnectv1alpha1.KonnectGatewayControlPlane:
err = deleteControlPlane(ctx, sdk.GetControlPlaneSDK(), ent)
case *configurationv1alpha1.KongService:
Expand Down Expand Up @@ -243,7 +242,7 @@ func Delete[
return fmt.Errorf("unsupported entity type %T", ent)
}

logOpComplete[T, TEnt](ctx, start, DeleteOp, e, err)
logOpComplete[T, TEnt](ctx, start, DeleteOp, ent, err)

return err
}
Expand Down
6 changes: 3 additions & 3 deletions controller/konnect/ops/ops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import (
"context"
"testing"

sdkkonnectops "github.com/Kong/sdk-konnect-go/models/operations"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
fakectrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client/fake"

sdkkonnectops "github.com/Kong/sdk-konnect-go/models/operations"
konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1"

"github.com/kong/gateway-operator/controller/konnect/constraints"
sdkmocks "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mocks"
"github.com/kong/gateway-operator/modules/manager/scheme"

konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1"
)

type deleteTestCase[
Expand Down

0 comments on commit ff10d9e

Please sign in to comment.