diff --git a/pkg/webhook/controlplane/ensurer.go b/pkg/webhook/controlplane/ensurer.go index ff4f40b14..0d3c1efc2 100644 --- a/pkg/webhook/controlplane/ensurer.go +++ b/pkg/webhook/controlplane/ensurer.go @@ -25,7 +25,6 @@ import ( "github.com/23technologies/gardener-extension-provider-hcloud/pkg/hcloud" "github.com/23technologies/gardener-extension-provider-hcloud/pkg/hcloud/apis/transcoder" - controllerapis "github.com/23technologies/gardener-extension-provider-hcloud/pkg/hcloud/apis/controller" "github.com/Masterminds/semver" "github.com/coreos/go-systemd/v22/unit" @@ -46,11 +45,13 @@ import ( kubeletconfigv1beta1 "k8s.io/kubelet/config/v1beta1" "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" ) // NewEnsurer creates a new controlplane ensurer. -func NewEnsurer(logger logr.Logger, gardenletManagesMCM bool) genericmutator.Ensurer { +func NewEnsurer(mgr manager.Manager, logger logr.Logger, gardenletManagesMCM bool) genericmutator.Ensurer { return &ensurer{ + client: mgr.GetClient(), logger: logger.WithName("hcloud-controlplane-ensurer"), gardenletManagesMCM: gardenletManagesMCM, } diff --git a/pkg/webhook/controlplane/registration.go b/pkg/webhook/controlplane/registration.go index 2fa61e6ed..7537a2200 100644 --- a/pkg/webhook/controlplane/registration.go +++ b/pkg/webhook/controlplane/registration.go @@ -54,7 +54,7 @@ func AddToManager(mgr manager.Manager) (*extensionswebhook.Webhook, error) { }, Mutator: genericmutator.NewMutator( mgr, - NewEnsurer(logger, GardenletManagesMCM), + NewEnsurer(mgr, logger, GardenletManagesMCM), oscutils.NewUnitSerializer(), kubelet.NewConfigCodec(fciCodec), fciCodec,