diff --git a/api/v1alpha1/ramenconfig_types.go b/api/v1alpha1/ramenconfig_types.go index 0c860bfd6..cebb50abf 100644 --- a/api/v1alpha1/ramenconfig_types.go +++ b/api/v1alpha1/ramenconfig_types.go @@ -6,7 +6,7 @@ package v1alpha1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - configv1alpha1 "k8s.io/component-base/config/v1alpha1" + cfg "sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" ) // ControllerType is the type of controller to run diff --git a/cmd/main.go b/cmd/main.go index 90c981796..cabab141d 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -82,8 +82,9 @@ func bindFlags(bindfuncs ...func(*flag.FlagSet)) { func buildOptions() (*ctrl.Options, *ramendrv1alpha1.RamenConfig) { ctrlOptions := ctrl.Options{Scheme: scheme} - ramenConfig := controllers.LoadControllerConfig(configFile, setupLog) - controllers.LoadControllerOptions(&ctrlOptions, ramenConfig) + ramenConfig := &ramendrv1alpha1.RamenConfig{} + + controllers.LoadControllerConfig(configFile, setupLog, &ctrlOptions, ramenConfig) return &ctrlOptions, ramenConfig } diff --git a/internal/controller/drcluster_mmode_test.go b/internal/controller/drcluster_mmode_test.go index 8be135b04..103e5ab3b 100644 --- a/internal/controller/drcluster_mmode_test.go +++ b/internal/controller/drcluster_mmode_test.go @@ -97,12 +97,14 @@ var _ = Describe("DRClusterMModeTests", Ordered, func() { Kind: "RamenConfig", APIVersion: rmn.GroupVersion.String(), }, - LeaderElection: &config.LeaderElectionConfiguration{ - LeaderElect: new(bool), - ResourceName: ramencontrollers.HubLeaderElectionResourceName, - }, - Metrics: rmn.ControllerMetrics{ - BindAddress: "0", // Disable metrics + ControllerManagerConfigurationSpec: controller_runtime_config.ControllerManagerConfigurationSpec{ + LeaderElection: &config.LeaderElectionConfiguration{ + LeaderElect: new(bool), + ResourceName: ramencontrollers.HubLeaderElectionResourceName, + }, + Metrics: controller_runtime_config.ControllerMetrics{ + BindAddress: "0", // Disable metrics + }, }, RamenControllerType: rmn.DRHubType, S3StoreProfiles: []rmn.S3StoreProfile{