Skip to content

Commit

Permalink
fixup! refactor: Remove unused decoder property in meta generators
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmidyson committed Oct 11, 2023
1 parent ef44858 commit afce9b1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 11 deletions.
3 changes: 0 additions & 3 deletions common/pkg/capi/clustertopology/handlers/mutation/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,15 @@ type MetaMutator interface {

type metaGeneratePatches struct {
name string
decoder runtime.Decoder
mutators []MetaMutator
}

func NewMetaGeneratePatchesHandler(
name string,
decoder runtime.Decoder,
mutators ...MetaMutator,
) handlers.Named {
return metaGeneratePatches{
name: name,
decoder: decoder,
mutators: mutators,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
runtimehooksv1 "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/apis"
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/patches"
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/patches/selectors"
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/testutils/capitest/request"
Expand Down Expand Up @@ -220,7 +219,7 @@ func TestMetaGeneratePatches(t *testing.T) {

g := gomega.NewWithT(t)

h := NewMetaGeneratePatchesHandler("", apis.CAPIDecoder(), tt.mutaters...).(GeneratePatches)
h := NewMetaGeneratePatchesHandler("", tt.mutaters...).(GeneratePatches)

resp := &runtimehooksv1.GeneratePatchesResponse{}
h.GeneratePatches(context.Background(), &runtimehooksv1.GeneratePatchesRequest{
Expand Down
3 changes: 0 additions & 3 deletions pkg/handlers/aws/mutation/metapatch_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package mutation
import (
"sigs.k8s.io/controller-runtime/pkg/manager"

"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/apis"
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/handlers"
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/handlers/mutation"
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/aws/mutation/cni/calico"
Expand All @@ -30,7 +29,6 @@ func MetaPatchHandler(mgr manager.Manager) handlers.Named {

return mutation.NewMetaGeneratePatchesHandler(
"awsClusterConfigPatch",
apis.CAPADecoder(),
patchHandlers...,
)
}
Expand All @@ -44,7 +42,6 @@ func MetaWorkerPatchHandler() handlers.Named {

return mutation.NewMetaGeneratePatchesHandler(
"awsWorkerConfigPatch",
apis.CAPADecoder(),
patchHandlers...,
)
}
3 changes: 0 additions & 3 deletions pkg/handlers/docker/mutation/metapatch_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package mutation
import (
"sigs.k8s.io/controller-runtime/pkg/manager"

"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/apis"
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/handlers"
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/handlers/mutation"
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/docker/mutation/customimage"
Expand All @@ -24,7 +23,6 @@ func MetaPatchHandler(mgr manager.Manager) handlers.Named {

return mutation.NewMetaGeneratePatchesHandler(
"dockerClusterConfigPatch",
apis.CAPDDecoder(),
patchHandlers...,
)
}
Expand All @@ -37,7 +35,6 @@ func MetaWorkerPatchHandler() handlers.Named {

return mutation.NewMetaGeneratePatchesHandler(
"dockerWorkerConfigPatch",
apis.CAPDDecoder(),
patchHandlers...,
)
}

0 comments on commit afce9b1

Please sign in to comment.