From d6380bf194cecc9da06bea4eac4425b82a945320 Mon Sep 17 00:00:00 2001 From: duanmengkk Date: Sun, 24 Dec 2023 17:03:34 +0800 Subject: [PATCH] add finalizer for mcs and fix some bug Signed-off-by: duanmengkk --- cmd/clustertree/cluster-manager/app/options/options.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/clustertree/cluster-manager/app/options/options.go b/cmd/clustertree/cluster-manager/app/options/options.go index c2609ff45..e44cbe5d0 100644 --- a/cmd/clustertree/cluster-manager/app/options/options.go +++ b/cmd/clustertree/cluster-manager/app/options/options.go @@ -6,6 +6,7 @@ import ( componentbaseconfig "k8s.io/component-base/config" "k8s.io/component-base/config/options" componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" + "time" "github.com/kosmos.io/kosmos/pkg/utils/flags" ) @@ -46,6 +47,8 @@ type Options struct { RateLimiterOpts flags.Options BackoffOpts flags.BackoffOptions + + SyncPeriod time.Duration } type KubernetesOptions struct { @@ -88,6 +91,7 @@ func (o *Options) AddFlags(flags *pflag.FlagSet) { flags.BoolVar(&o.OnewayStorageControllers, "oneway-storage-controllers", false, "Turn on or off oneway storage controllers.") flags.StringSliceVar(&o.AutoCreateMCSPrefix, "auto-mcs-prefix", []string{}, "The prefix of namespace for service to auto create mcs resources") flags.StringSliceVar(&o.ReservedNamespaces, "reserved-namespaces", []string{"kube-system"}, "The namespaces protected by Kosmos that the controller-manager will skip.") + flags.DurationVar(&o.SyncPeriod, "sync-period", 0, "the sync period for informer to resync.") o.RateLimiterOpts.AddFlags(flags) o.BackoffOpts.AddFlags(flags) options.BindLeaderElectionFlags(&o.LeaderElection, flags)