Merge pull request #1265 from Garrybest/pr_resync
stop resync for controllers
This commit is contained in:
commit
7c78d03c3b
|
@ -5,6 +5,7 @@ import (
|
|||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
|
@ -115,8 +116,11 @@ func run(ctx context.Context, karmadaConfig karmadactl.KarmadaConfig, opts *opti
|
|||
return err
|
||||
}
|
||||
|
||||
// TODO(Garrybest): add resyncPeriod to options
|
||||
resyncPeriod := time.Duration(0)
|
||||
controllerManager, err := controllerruntime.NewManager(controlPlaneRestConfig, controllerruntime.Options{
|
||||
Scheme: gclient.NewSchema(),
|
||||
SyncPeriod: &resyncPeriod,
|
||||
Namespace: executionSpace,
|
||||
LeaderElection: opts.LeaderElection.LeaderElect,
|
||||
LeaderElectionID: fmt.Sprintf("karmada-agent-%s", opts.ClusterName),
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"net"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/client-go/discovery"
|
||||
|
@ -74,8 +75,11 @@ func Run(ctx context.Context, opts *options.Options) error {
|
|||
panic(err)
|
||||
}
|
||||
config.QPS, config.Burst = opts.KubeAPIQPS, opts.KubeAPIBurst
|
||||
// TODO(Garrybest): add resyncPeriod to options
|
||||
resyncPeriod := time.Duration(0)
|
||||
controllerManager, err := controllerruntime.NewManager(config, controllerruntime.Options{
|
||||
Scheme: gclient.NewSchema(),
|
||||
SyncPeriod: &resyncPeriod,
|
||||
LeaderElection: opts.LeaderElection.LeaderElect,
|
||||
LeaderElectionID: opts.LeaderElection.ResourceName,
|
||||
LeaderElectionNamespace: opts.LeaderElection.ResourceNamespace,
|
||||
|
|
Loading…
Reference in New Issue