Browse code

mark validation commands as deprecated

Steve Kuznetsov authored on 2016/01/13 02:45:08
Showing 4 changed files
... ...
@@ -13435,209 +13435,6 @@ _openshift_kube()
13435 13435
     must_have_one_noun=()
13436 13436
 }
13437 13437
 
13438
-_openshift_ex_validate_master-config()
13439
-{
13440
-    last_command="openshift_ex_validate_master-config"
13441
-    commands=()
13442
-
13443
-    flags=()
13444
-    two_word_flags=()
13445
-    flags_with_completion=()
13446
-    flags_completion=()
13447
-
13448
-    flags+=("--alsologtostderr")
13449
-    flags+=("--api-version=")
13450
-    flags+=("--boot-id-file=")
13451
-    flags+=("--certificate-authority=")
13452
-    flags_with_completion+=("--certificate-authority")
13453
-    flags_completion+=("_filedir")
13454
-    flags+=("--client-certificate=")
13455
-    flags_with_completion+=("--client-certificate")
13456
-    flags_completion+=("_filedir")
13457
-    flags+=("--client-key=")
13458
-    flags_with_completion+=("--client-key")
13459
-    flags_completion+=("_filedir")
13460
-    flags+=("--cluster=")
13461
-    flags+=("--config=")
13462
-    flags_with_completion+=("--config")
13463
-    flags_completion+=("_filedir")
13464
-    flags+=("--container-hints=")
13465
-    flags+=("--context=")
13466
-    flags+=("--docker=")
13467
-    flags+=("--docker-only")
13468
-    flags+=("--docker-root=")
13469
-    flags+=("--docker-run=")
13470
-    flags+=("--enable-load-reader")
13471
-    flags+=("--event-storage-age-limit=")
13472
-    flags+=("--event-storage-event-limit=")
13473
-    flags+=("--global-housekeeping-interval=")
13474
-    flags+=("--google-json-key=")
13475
-    flags+=("--housekeeping-interval=")
13476
-    flags+=("--httptest.serve=")
13477
-    flags+=("--insecure-skip-tls-verify")
13478
-    flags+=("--ir-data-source=")
13479
-    flags+=("--ir-dbname=")
13480
-    flags+=("--ir-influxdb-host=")
13481
-    flags+=("--ir-namespace-only")
13482
-    flags+=("--ir-password=")
13483
-    flags+=("--ir-percentile=")
13484
-    flags+=("--ir-user=")
13485
-    flags+=("--log-backtrace-at=")
13486
-    flags+=("--log-cadvisor-usage")
13487
-    flags+=("--log-dir=")
13488
-    flags+=("--log-flush-frequency=")
13489
-    flags+=("--logtostderr")
13490
-    flags+=("--machine-id-file=")
13491
-    flags+=("--match-server-version")
13492
-    flags+=("--namespace=")
13493
-    two_word_flags+=("-n")
13494
-    flags+=("--server=")
13495
-    flags+=("--stderrthreshold=")
13496
-    flags+=("--token=")
13497
-    flags+=("--user=")
13498
-    flags+=("--v=")
13499
-    flags+=("--vmodule=")
13500
-
13501
-    must_have_one_flag=()
13502
-    must_have_one_noun=()
13503
-}
13504
-
13505
-_openshift_ex_validate_node-config()
13506
-{
13507
-    last_command="openshift_ex_validate_node-config"
13508
-    commands=()
13509
-
13510
-    flags=()
13511
-    two_word_flags=()
13512
-    flags_with_completion=()
13513
-    flags_completion=()
13514
-
13515
-    flags+=("--alsologtostderr")
13516
-    flags+=("--api-version=")
13517
-    flags+=("--boot-id-file=")
13518
-    flags+=("--certificate-authority=")
13519
-    flags_with_completion+=("--certificate-authority")
13520
-    flags_completion+=("_filedir")
13521
-    flags+=("--client-certificate=")
13522
-    flags_with_completion+=("--client-certificate")
13523
-    flags_completion+=("_filedir")
13524
-    flags+=("--client-key=")
13525
-    flags_with_completion+=("--client-key")
13526
-    flags_completion+=("_filedir")
13527
-    flags+=("--cluster=")
13528
-    flags+=("--config=")
13529
-    flags_with_completion+=("--config")
13530
-    flags_completion+=("_filedir")
13531
-    flags+=("--container-hints=")
13532
-    flags+=("--context=")
13533
-    flags+=("--docker=")
13534
-    flags+=("--docker-only")
13535
-    flags+=("--docker-root=")
13536
-    flags+=("--docker-run=")
13537
-    flags+=("--enable-load-reader")
13538
-    flags+=("--event-storage-age-limit=")
13539
-    flags+=("--event-storage-event-limit=")
13540
-    flags+=("--global-housekeeping-interval=")
13541
-    flags+=("--google-json-key=")
13542
-    flags+=("--housekeeping-interval=")
13543
-    flags+=("--httptest.serve=")
13544
-    flags+=("--insecure-skip-tls-verify")
13545
-    flags+=("--ir-data-source=")
13546
-    flags+=("--ir-dbname=")
13547
-    flags+=("--ir-influxdb-host=")
13548
-    flags+=("--ir-namespace-only")
13549
-    flags+=("--ir-password=")
13550
-    flags+=("--ir-percentile=")
13551
-    flags+=("--ir-user=")
13552
-    flags+=("--log-backtrace-at=")
13553
-    flags+=("--log-cadvisor-usage")
13554
-    flags+=("--log-dir=")
13555
-    flags+=("--log-flush-frequency=")
13556
-    flags+=("--logtostderr")
13557
-    flags+=("--machine-id-file=")
13558
-    flags+=("--match-server-version")
13559
-    flags+=("--namespace=")
13560
-    two_word_flags+=("-n")
13561
-    flags+=("--server=")
13562
-    flags+=("--stderrthreshold=")
13563
-    flags+=("--token=")
13564
-    flags+=("--user=")
13565
-    flags+=("--v=")
13566
-    flags+=("--vmodule=")
13567
-
13568
-    must_have_one_flag=()
13569
-    must_have_one_noun=()
13570
-}
13571
-
13572
-_openshift_ex_validate()
13573
-{
13574
-    last_command="openshift_ex_validate"
13575
-    commands=()
13576
-    commands+=("master-config")
13577
-    commands+=("node-config")
13578
-
13579
-    flags=()
13580
-    two_word_flags=()
13581
-    flags_with_completion=()
13582
-    flags_completion=()
13583
-
13584
-    flags+=("--alsologtostderr")
13585
-    flags+=("--api-version=")
13586
-    flags+=("--boot-id-file=")
13587
-    flags+=("--certificate-authority=")
13588
-    flags_with_completion+=("--certificate-authority")
13589
-    flags_completion+=("_filedir")
13590
-    flags+=("--client-certificate=")
13591
-    flags_with_completion+=("--client-certificate")
13592
-    flags_completion+=("_filedir")
13593
-    flags+=("--client-key=")
13594
-    flags_with_completion+=("--client-key")
13595
-    flags_completion+=("_filedir")
13596
-    flags+=("--cluster=")
13597
-    flags+=("--config=")
13598
-    flags_with_completion+=("--config")
13599
-    flags_completion+=("_filedir")
13600
-    flags+=("--container-hints=")
13601
-    flags+=("--context=")
13602
-    flags+=("--docker=")
13603
-    flags+=("--docker-only")
13604
-    flags+=("--docker-root=")
13605
-    flags+=("--docker-run=")
13606
-    flags+=("--enable-load-reader")
13607
-    flags+=("--event-storage-age-limit=")
13608
-    flags+=("--event-storage-event-limit=")
13609
-    flags+=("--global-housekeeping-interval=")
13610
-    flags+=("--google-json-key=")
13611
-    flags+=("--housekeeping-interval=")
13612
-    flags+=("--httptest.serve=")
13613
-    flags+=("--insecure-skip-tls-verify")
13614
-    flags+=("--ir-data-source=")
13615
-    flags+=("--ir-dbname=")
13616
-    flags+=("--ir-influxdb-host=")
13617
-    flags+=("--ir-namespace-only")
13618
-    flags+=("--ir-password=")
13619
-    flags+=("--ir-percentile=")
13620
-    flags+=("--ir-user=")
13621
-    flags+=("--log-backtrace-at=")
13622
-    flags+=("--log-cadvisor-usage")
13623
-    flags+=("--log-dir=")
13624
-    flags+=("--log-flush-frequency=")
13625
-    flags+=("--logtostderr")
13626
-    flags+=("--machine-id-file=")
13627
-    flags+=("--match-server-version")
13628
-    flags+=("--namespace=")
13629
-    two_word_flags+=("-n")
13630
-    flags+=("--server=")
13631
-    flags+=("--stderrthreshold=")
13632
-    flags+=("--token=")
13633
-    flags+=("--user=")
13634
-    flags+=("--v=")
13635
-    flags+=("--vmodule=")
13636
-
13637
-    must_have_one_flag=()
13638
-    must_have_one_noun=()
13639
-}
13640
-
13641 13438
 _openshift_ex_tokens_validate-token()
13642 13439
 {
13643 13440
     last_command="openshift_ex_tokens_validate-token"
... ...
@@ -14319,7 +14116,6 @@ _openshift_ex()
14319 14319
 {
14320 14320
     last_command="openshift_ex"
14321 14321
     commands=()
14322
-    commands+=("validate")
14323 14322
     commands+=("tokens")
14324 14323
     commands+=("ipfailover")
14325 14324
     commands+=("build-chain")
... ...
@@ -27,6 +27,8 @@ This command validates that a configuration file intended to be used for a maste
27 27
 
28 28
 	validateMasterConfigExample = ` // Validate master server configuration file
29 29
   $ %s openshift.local.config/master/master-config.yaml`
30
+
31
+	validateMasterConfigDeprecationMessage = `This command is deprecated and will be removed. Use 'openshift ex diagnostics MasterConfigCheck --master-config=path/to/config.yaml' instead.`
30 32
 )
31 33
 
32 34
 type ValidateMasterConfigOptions struct {
... ...
@@ -44,10 +46,11 @@ func NewCommandValidateMasterConfig(name, fullName string, out io.Writer) *cobra
44 44
 	}
45 45
 
46 46
 	cmd := &cobra.Command{
47
-		Use:     fmt.Sprintf("%s SOURCE", name),
48
-		Short:   "Validate the configuration file for a master server",
49
-		Long:    validateMasterConfigLong,
50
-		Example: fmt.Sprintf(validateMasterConfigExample, fullName),
47
+		Use:        fmt.Sprintf("%s SOURCE", name),
48
+		Short:      "Validate the configuration file for a master server",
49
+		Long:       validateMasterConfigLong,
50
+		Example:    fmt.Sprintf(validateMasterConfigExample, fullName),
51
+		Deprecated: validateMasterConfigDeprecationMessage,
51 52
 		Run: func(c *cobra.Command, args []string) {
52 53
 			if err := options.Complete(args); err != nil {
53 54
 				cmdutil.CheckErr(cmdutil.UsageError(c, err.Error()))
... ...
@@ -26,6 +26,8 @@ This command validates that a configuration file intended to be used for a node
26 26
 
27 27
 	valiateNodeConfigExample = ` // Validate node configuration file
28 28
   $ %s openshift.local.config/master/node-config.yaml`
29
+
30
+	validateNodeConfigDeprecationMessage = `This command is deprecated and will be removed. Use 'openshift ex diagnostics NodeConfigCheck --node-config=<path/to/config.yaml' instead.`
29 31
 )
30 32
 
31 33
 type ValidateNodeConfigOptions struct {
... ...
@@ -43,10 +45,11 @@ func NewCommandValidateNodeConfig(name, fullName string, out io.Writer) *cobra.C
43 43
 	}
44 44
 
45 45
 	cmd := &cobra.Command{
46
-		Use:     fmt.Sprintf("%s SOURCE", name),
47
-		Short:   "Validate the configuration file for a node",
48
-		Long:    validateNodeConfigLong,
49
-		Example: fmt.Sprintf(valiateNodeConfigExample, fullName),
46
+		Use:        fmt.Sprintf("%s SOURCE", name),
47
+		Short:      "Validate the configuration file for a node",
48
+		Long:       validateNodeConfigLong,
49
+		Example:    fmt.Sprintf(valiateNodeConfigExample, fullName),
50
+		Deprecated: validateNodeConfigDeprecationMessage,
50 51
 		Run: func(c *cobra.Command, args []string) {
51 52
 			if err := options.Complete(args); err != nil {
52 53
 				cmdutil.CheckErr(cmdutil.UsageError(c, err.Error()))
... ...
@@ -8,20 +8,26 @@ import (
8 8
 	cmdutil "github.com/openshift/origin/pkg/cmd/util"
9 9
 )
10 10
 
11
-const ValidateRecommendedName = "validate"
11
+const (
12
+	ValidateRecommendedName = "validate"
12 13
 
13
-const validateLong = `Validate configuration file integrity
14
+	validateLong = `Validate configuration file integrity
14 15
 
15 16
 The commands here allow administrators to validate the integrity of configuration files.
16 17
 `
17 18
 
19
+	validateDeprecationMessage = `The commands here are deprecated and will be removed. Use 'openshift ex diagnostics' to run configuration validations instead.
20
+See sub-command help text for specific instructions with 'openshift ex diagnostics'.`
21
+)
22
+
18 23
 func NewCommandValidate(name, fullName string, out io.Writer) *cobra.Command {
19 24
 	// Parent command to which all subcommands are added.
20 25
 	cmds := &cobra.Command{
21
-		Use:   name,
22
-		Short: "Validate configuration file integrity",
23
-		Long:  validateLong,
24
-		Run:   cmdutil.DefaultSubCommandRun(out),
26
+		Use:        name,
27
+		Short:      "Validate configuration file integrity",
28
+		Long:       validateLong,
29
+		Deprecated: validateDeprecationMessage,
30
+		Run:        cmdutil.DefaultSubCommandRun(out),
25 31
 	}
26 32
 
27 33
 	cmds.AddCommand(NewCommandValidateMasterConfig(ValidateMasterConfigRecommendedName,