Skip to content

Commit

Permalink
Use client from manager
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Schneider <[email protected]>
  • Loading branch information
JensAc committed Aug 31, 2023
1 parent 761da43 commit 5cec71b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/webhook/controlplane/ensurer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhook/controlplane/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5cec71b

Please sign in to comment.