You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/cmd.go
+49-28Lines changed: 49 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -162,7 +162,8 @@ var (
162
162
podSchedulingGracePeriod time.Duration
163
163
}
164
164
operatorImageDiscoverystruct {
165
-
timeout time.Duration
165
+
timeout time.Duration
166
+
//deprecated: Do not use this flag, as discovery methog changed
166
167
defaultStatusDiscoverybool
167
168
}
168
169
operatorReconciliationRetrystruct {
@@ -191,6 +192,12 @@ var (
191
192
)
192
193
193
194
funcinit() {
195
+
iferr:=initE(); err!=nil {
196
+
panic(err.Error())
197
+
}
198
+
}
199
+
200
+
funcinitE() error {
194
201
vardeprecatedStrstring
195
202
196
203
f:=cmdMain.Flags()
@@ -217,20 +224,14 @@ func init() {
217
224
f.BoolVar(&operatorOptions.enablePlatform, "operator.platform", false, "Enable to run the Platform operator")
218
225
f.BoolVar(&operatorOptions.enableScheduler, "operator.scheduler", false, "Enable to run the Scheduler operator")
219
226
f.BoolVar(&operatorOptions.enableK2KClusterSync, "operator.k2k-cluster-sync", false, "Enable to run the ListSimple operator")
220
-
f.MarkDeprecated("operator.k2k-cluster-sync", "Enabled within deployment operator")
221
227
f.BoolVar(&operatorOptions.versionOnly, "operator.version", false, "Enable only version endpoint in Operator")
222
228
f.StringVar(&deprecatedStr, "operator.alpine-image", "alpine:3.7", "Docker image used for alpine containers")
223
-
f.MarkDeprecated("operator.alpine-image", "Value is not used anymore")
224
229
f.StringVar(&deprecatedStr, "operator.metrics-exporter-image", "arangodb/arangodb-exporter:0.1.6", "Docker image used for metrics containers by default")
225
-
f.MarkDeprecated("operator.metrics-exporter-image", "Value is not used anymore")
226
230
f.StringVar(&deprecatedStr, "operator.arango-image", "arangodb/arangodb:latest", "Docker image used for arango by default")
227
-
f.MarkDeprecated("operator.arango-image", "Value is not used anymore")
228
231
f.BoolVar(&chaosOptions.allowed, "chaos.allowed", false, "Set to allow chaos in deployments. Only activated when allowed and enabled in deployment")
229
232
f.BoolVar(&operatorOptions.skipLeaderLabel, "leader.label.skip", false, "Skips Leader Label for the Pod")
230
233
f.BoolVar(&operatorOptions.singleMode, "mode.single", false, "Enable single mode in Operator. WARNING: There should be only one replica of Operator, otherwise Operator can take unexpected actions")
231
234
f.String("scope", "", "Define scope on which Operator works. Legacy - pre 1.1.0 scope with limited cluster access")
232
-
f.MarkDeprecated("scope", "Value is not used anymore")
233
-
f.MarkHidden("scope")
234
235
f.DurationVar(&operatorTimeouts.k8s, "timeout.k8s", globals.DefaultKubernetesTimeout, "The request timeout to the kubernetes")
235
236
f.DurationVar(&operatorTimeouts.arangoD, "timeout.arangod", globals.DefaultArangoDTimeout, "The request timeout to the ArangoDB")
236
237
f.DurationVar(&operatorTimeouts.arangoDCheck, "timeout.arangod-check", globals.DefaultArangoDCheckTimeout, "The version check request timeout to the ArangoDB")
@@ -260,21 +261,35 @@ func init() {
260
261
f.BoolVar(&operatorImageDiscovery.defaultStatusDiscovery, "image.discovery.status", true, "Discover Operator Image from Pod Status by default. When disabled Pod Spec is used.")
261
262
f.DurationVar(&operatorImageDiscovery.timeout, "image.discovery.timeout", time.Minute, "Timeout for image discovery process")
262
263
f.IntVar(&threads, "threads", 16, "Number of the worker threads")
263
-
iferr:=logging.Init(&cmdMain); err!=nil {
264
-
panic(err.Error())
265
-
}
266
-
iferr:=features.Init(&cmdMain); err!=nil {
267
-
panic(err.Error())
268
-
}
269
-
iferr:=agencyConfig.Init(&cmdMain); err!=nil {
270
-
panic(err.Error())
264
+
265
+
iferr:=errors.Errors(
266
+
f.MarkDeprecated("operator.k2k-cluster-sync", "Enabled within deployment operator"),
267
+
f.MarkDeprecated("operator.alpine-image", "Value is not used anymore"),
268
+
f.MarkDeprecated("operator.metrics-exporter-image", "Value is not used anymore"),
269
+
f.MarkDeprecated("operator.arango-image", "Value is not used anymore"),
270
+
f.MarkDeprecated("scope", "Value is not used anymore"),
271
+
f.MarkDeprecated("image.discovery.status", "Value fetched from the Operator Spec"),
272
+
); err!=nil {
273
+
returnerrors.Wrap(err, "Unable to mark flags as deprecated")
0 commit comments