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"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
|
@ -115,8 +116,11 @@ func run(ctx context.Context, karmadaConfig karmadactl.KarmadaConfig, opts *opti
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(Garrybest): add resyncPeriod to options
|
||||||
|
resyncPeriod := time.Duration(0)
|
||||||
controllerManager, err := controllerruntime.NewManager(controlPlaneRestConfig, controllerruntime.Options{
|
controllerManager, err := controllerruntime.NewManager(controlPlaneRestConfig, controllerruntime.Options{
|
||||||
Scheme: gclient.NewSchema(),
|
Scheme: gclient.NewSchema(),
|
||||||
|
SyncPeriod: &resyncPeriod,
|
||||||
Namespace: 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),
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"k8s.io/client-go/discovery"
|
"k8s.io/client-go/discovery"
|
||||||
|
@ -74,8 +75,11 @@ func Run(ctx context.Context, opts *options.Options) error {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
config.QPS, config.Burst = opts.KubeAPIQPS, opts.KubeAPIBurst
|
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{
|
controllerManager, err := controllerruntime.NewManager(config, controllerruntime.Options{
|
||||||
Scheme: gclient.NewSchema(),
|
Scheme: gclient.NewSchema(),
|
||||||
|
SyncPeriod: &resyncPeriod,
|
||||||
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