Skip to content

Commit ce2267c

Browse files
authored
Merge pull request #1295 from XiShanYongYe-Chang/automated-cherry-pick-of-#1265-upstream-release-1.0
Automated cherry pick of #1265: set resync period to 0
2 parents 9220650 + 0a33037 commit ce2267c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

cmd/agent/app/agent.go

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"flag"
66
"fmt"
77
"os"
8+
"time"
89

910
"github.com/spf13/cobra"
1011
corev1 "k8s.io/api/core/v1"
@@ -115,8 +116,11 @@ func run(ctx context.Context, karmadaConfig karmadactl.KarmadaConfig, opts *opti
115116
return err
116117
}
117118

119+
// TODO(Garrybest): add resyncPeriod to options
120+
resyncPeriod := time.Duration(0)
118121
controllerManager, err := controllerruntime.NewManager(controlPlaneRestConfig, controllerruntime.Options{
119122
Scheme: gclient.NewSchema(),
123+
SyncPeriod: &resyncPeriod,
120124
Namespace: executionSpace,
121125
LeaderElection: opts.LeaderElection.LeaderElect,
122126
LeaderElectionID: fmt.Sprintf("karmada-agent-%s", opts.ClusterName),

cmd/controller-manager/app/controllermanager.go

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"net"
77
"os"
88
"strconv"
9+
"time"
910

1011
"github.com/spf13/cobra"
1112
"k8s.io/client-go/discovery"
@@ -74,8 +75,11 @@ func Run(ctx context.Context, opts *options.Options) error {
7475
panic(err)
7576
}
7677
config.QPS, config.Burst = opts.KubeAPIQPS, opts.KubeAPIBurst
78+
// TODO(Garrybest): add resyncPeriod to options
79+
resyncPeriod := time.Duration(0)
7780
controllerManager, err := controllerruntime.NewManager(config, controllerruntime.Options{
7881
Scheme: gclient.NewSchema(),
82+
SyncPeriod: &resyncPeriod,
7983
LeaderElection: opts.LeaderElection.LeaderElect,
8084
LeaderElectionID: opts.LeaderElection.ResourceName,
8185
LeaderElectionNamespace: opts.LeaderElection.ResourceNamespace,

0 commit comments

Comments
 (0)