Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using deprecated ControllerManagerConfig in controller-runtime pkg #10

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/v1alpha1/ramenconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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"

Check failure on line 9 in api/v1alpha1/ramenconfig_types.go

View workflow job for this annotation

GitHub Actions / Build image

"sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" imported as cfg and not used

Check failure on line 9 in api/v1alpha1/ramenconfig_types.go

View workflow job for this annotation

GitHub Actions / Build image

"sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" imported as cfg and not used
)

// ControllerType is the type of controller to run
Expand Down Expand Up @@ -111,7 +111,7 @@
// LeaderElection is the LeaderElection config to be used when configuring
// the manager.Manager leader election
// +optional
LeaderElection *configv1alpha1.LeaderElectionConfiguration `json:"leaderElection,omitempty"`

Check failure on line 114 in api/v1alpha1/ramenconfig_types.go

View workflow job for this annotation

GitHub Actions / Build image

undefined: configv1alpha1

Check failure on line 114 in api/v1alpha1/ramenconfig_types.go

View workflow job for this annotation

GitHub Actions / Build image

undefined: configv1alpha1

// Metrics contains the controller metrics configuration
// +optional
Expand Down
5 changes: 3 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
14 changes: 8 additions & 6 deletions internal/controller/drcluster_mmode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Loading