Skip to content

Commit

Permalink
Merge pull request #1295 from XiShanYongYe-Chang/automated-cherry-pic…
Browse files Browse the repository at this point in the history
…k-of-#1265-upstream-release-1.0

Automated cherry pick of #1265: set resync period to 0
  • Loading branch information
karmada-bot committed Jan 21, 2022
2 parents 9220650 + 0a33037 commit ce2267c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/agent/app/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"os"
"time"

"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 4 additions & 0 deletions cmd/controller-manager/app/controllermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net"
"os"
"strconv"
"time"

"github.com/spf13/cobra"
"k8s.io/client-go/discovery"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ce2267c

Please sign in to comment.