Merge pull request #4459 from yanfeng1992/fix-controllerruntime-option
cleanup controllerruntime deprecated option SyncPeriod Namespace
This commit is contained in:
commit
bff8aa90fb
|
@ -196,8 +196,7 @@ func run(ctx context.Context, opts *options.Options) error {
|
||||||
|
|
||||||
controllerManager, err := controllerruntime.NewManager(controlPlaneRestConfig, controllerruntime.Options{
|
controllerManager, err := controllerruntime.NewManager(controlPlaneRestConfig, controllerruntime.Options{
|
||||||
Scheme: gclient.NewSchema(),
|
Scheme: gclient.NewSchema(),
|
||||||
SyncPeriod: &opts.ResyncPeriod.Duration,
|
Cache: cache.Options{SyncPeriod: &opts.ResyncPeriod.Duration, Namespaces: []string{executionSpace}},
|
||||||
Namespace: executionSpace,
|
|
||||||
LeaderElection: opts.LeaderElection.LeaderElect,
|
LeaderElection: opts.LeaderElection.LeaderElect,
|
||||||
LeaderElectionID: fmt.Sprintf("karmada-agent-%s", opts.ClusterName),
|
LeaderElectionID: fmt.Sprintf("karmada-agent-%s", opts.ClusterName),
|
||||||
LeaderElectionNamespace: opts.LeaderElection.ResourceNamespace,
|
LeaderElectionNamespace: opts.LeaderElection.ResourceNamespace,
|
||||||
|
|
|
@ -145,7 +145,7 @@ func Run(ctx context.Context, opts *options.Options) error {
|
||||||
controllerManager, err := controllerruntime.NewManager(controlPlaneRestConfig, controllerruntime.Options{
|
controllerManager, err := controllerruntime.NewManager(controlPlaneRestConfig, controllerruntime.Options{
|
||||||
Logger: klog.Background(),
|
Logger: klog.Background(),
|
||||||
Scheme: gclient.NewSchema(),
|
Scheme: gclient.NewSchema(),
|
||||||
SyncPeriod: &opts.ResyncPeriod.Duration,
|
Cache: cache.Options{SyncPeriod: &opts.ResyncPeriod.Duration},
|
||||||
LeaderElection: opts.LeaderElection.LeaderElect,
|
LeaderElection: opts.LeaderElection.LeaderElect,
|
||||||
LeaderElectionID: opts.LeaderElection.ResourceName,
|
LeaderElectionID: opts.LeaderElection.ResourceName,
|
||||||
LeaderElectionNamespace: opts.LeaderElection.ResourceNamespace,
|
LeaderElectionNamespace: opts.LeaderElection.ResourceNamespace,
|
||||||
|
|
Loading…
Reference in New Issue