MCPcopy
hub / github.com/kubevela/kubevela / Flags

Method Flags

cmd/core/app/options/options.go:106–180  ·  view source on GitHub ↗

Flags returns the complete NamedFlagSets

()

Source from the content-addressed store, hash-verified

104
105// Flags returns the complete NamedFlagSets
106func (s *CoreOptions) Flags() cliflag.NamedFlagSets {
107 fss := cliflag.NamedFlagSets{}
108
109 gfs := fss.FlagSet("generic")
110 gfs.BoolVar(&s.UseWebhook, "use-webhook", s.UseWebhook, "Enable Admission Webhook")
111 gfs.StringVar(&s.CertDir, "webhook-cert-dir", s.CertDir, "Admission webhook cert/key dir.")
112 gfs.IntVar(&s.WebhookPort, "webhook-port", s.WebhookPort, "admission webhook listen address")
113 gfs.StringVar(&s.MetricsAddr, "metrics-addr", s.MetricsAddr, "The address the metric endpoint binds to.")
114 gfs.BoolVar(&s.EnableLeaderElection, "enable-leader-election", s.EnableLeaderElection,
115 "Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
116 gfs.StringVar(&s.LeaderElectionNamespace, "leader-election-namespace", s.LeaderElectionNamespace,
117 "Determines the namespace in which the leader election configmap will be created.")
118 gfs.StringVar(&s.LogFilePath, "log-file-path", s.LogFilePath, "The file to write logs to.")
119 gfs.Uint64Var(&s.LogFileMaxSize, "log-file-max-size", s.LogFileMaxSize, "Defines the maximum size a log file can grow to, Unit is megabytes.")
120 gfs.BoolVar(&s.LogDebug, "log-debug", s.LogDebug, "Enable debug logs for development purpose")
121 gfs.BoolVar(&s.DevLogs, "dev-logs", s.DevLogs, "Enable ANSI color formatting for console logs (ignored when log-file-path is set)")
122 gfs.StringVar(&s.HealthAddr, "health-addr", s.HealthAddr, "The address the health endpoint binds to.")
123 gfs.DurationVar(&s.InformerSyncPeriod, "informer-sync-period", s.InformerSyncPeriod,
124 "The re-sync period for informer in controller-runtime. This is a system-level configuration.")
125 gfs.Float64Var(&s.QPS, "kube-api-qps", s.QPS, "the qps for reconcile clients. Low qps may lead to low throughput. High qps may give stress to api-server. Raise this value if concurrent-reconciles is set to be high.")
126 gfs.IntVar(&s.Burst, "kube-api-burst", s.Burst, "the burst for reconcile clients. Recommend setting it qps*2.")
127 gfs.DurationVar(&s.LeaseDuration, "leader-election-lease-duration", s.LeaseDuration,
128 "The duration that non-leader candidates will wait to force acquire leadership")
129 gfs.DurationVar(&s.RenewDeadLine, "leader-election-renew-deadline", s.RenewDeadLine,
130 "The duration that the acting controlplane will retry refreshing leadership before giving up")
131 gfs.DurationVar(&s.RetryPeriod, "leader-election-retry-period", s.RetryPeriod,
132 "The duration the LeaderElector clients should wait between tries of actions")
133 gfs.BoolVar(&s.EnableClusterGateway, "enable-cluster-gateway", s.EnableClusterGateway, "Enable cluster-gateway to use multicluster, disabled by default.")
134 gfs.BoolVar(&s.EnableClusterMetrics, "enable-cluster-metrics", s.EnableClusterMetrics, "Enable cluster-metrics-management to collect metrics from clusters with cluster-gateway, disabled by default. When this param is enabled, enable-cluster-gateway should be enabled")
135 gfs.DurationVar(&s.ClusterMetricsInterval, "cluster-metrics-interval", s.ClusterMetricsInterval, "The interval that ClusterMetricsMgr will collect metrics from clusters, default value is 15 seconds.")
136 gfs.BoolVar(&cuex.EnableExternalPackageForDefaultCompiler, "enable-external-package-for-default-compiler", cuex.EnableExternalPackageForDefaultCompiler, "Enable external package for default compiler")
137 gfs.BoolVar(&cuex.EnableExternalPackageWatchForDefaultCompiler, "enable-external-package-watch-for-default-compiler", cuex.EnableExternalPackageWatchForDefaultCompiler, "Enable external package watch for default compiler")
138
139 s.ControllerArgs.AddFlags(fss.FlagSet("controllerArgs"), s.ControllerArgs)
140
141 cfs := fss.FlagSet("commonconfig")
142 cfs.DurationVar(&commonconfig.ApplicationReSyncPeriod, "application-re-sync-period", commonconfig.ApplicationReSyncPeriod,
143 "Re-sync period for application to re-sync, also known as the state-keep interval.")
144 cfs.BoolVar(&commonconfig.PerfEnabled, "perf-enabled", commonconfig.PerfEnabled, "Enable performance logging for controllers, disabled by default.")
145
146 ofs := fss.FlagSet("oam")
147 ofs.StringVar(&oam.SystemDefinitionNamespace, "system-definition-namespace", "vela-system", "define the namespace of the system-level definition")
148
149 standardcontroller.AddOptimizeFlags(fss.FlagSet("optimize"))
150 standardcontroller.AddAdmissionFlags(fss.FlagSet("admission"))
151
152 rfs := fss.FlagSet("resourcekeeper")
153 rfs.IntVar(&resourcekeeper.MaxDispatchConcurrent, "max-dispatch-concurrent", 10, "Set the max dispatch concurrent number, default is 10")
154
155 wfs := fss.FlagSet("wfTypes")
156 wfs.IntVar(&wfTypes.MaxWorkflowWaitBackoffTime, "max-workflow-wait-backoff-time", 60, "Set the max workflow wait backoff time, default is 60")
157 wfs.IntVar(&wfTypes.MaxWorkflowFailedBackoffTime, "max-workflow-failed-backoff-time", 300, "Set the max workflow failed backoff time, default is 300")
158 wfs.IntVar(&wfTypes.MaxWorkflowStepErrorRetryTimes, "max-workflow-step-error-retry-times", 10, "Set the max workflow step error retry times, default is 10")
159
160 pkgmulticluster.AddFlags(fss.FlagSet("multicluster"))
161 ctrlrec.AddFlags(fss.FlagSet("controllerreconciles"))
162 utilfeature.DefaultMutableFeatureGate.AddFlag(fss.FlagSet("featuregate"))
163 sharding.AddFlags(fss.FlagSet("sharding"))

Callers 15

NewCoreCommandFunction · 0.95
TestCoreOptions_FlagsFunction · 0.95
TestCuexOptions_FlagsFunction · 0.95
GetNamespaceFunction · 0.80
GetNamespaceAndSourceFunction · 0.80
GetGroupFunction · 0.80
GetClusterFunction · 0.80
GetClustersFunction · 0.80
WithNamespaceFlagMethod · 0.80
WithClusterFlagMethod · 0.80
NewLogsCommandFunction · 0.80
NewEnvInitCommandFunction · 0.80

Calls 2

AddFlagsMethod · 0.80
SetMethod · 0.65

Tested by 6

TestCoreOptions_FlagsFunction · 0.76
TestCuexOptions_FlagsFunction · 0.76
TestDefaultNamespaceFunction · 0.64
initCommandFunction · 0.64
TestUpOverrideNamespaceFunction · 0.64