forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validate.go
38 lines (30 loc) · 1.22 KB
/
validate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package validate
import (
"io"
"github.com/spf13/cobra"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
)
const (
ValidateRecommendedName = "validate"
validateDeprecationMessage = `and will be removed. Use "oc adm diagnostics" to run configuration validations instead.
See sub-command help text for specific instructions with "oc adm diagnostics".`
)
var validateLong = templates.LongDesc(`
Validate configuration file integrity
The commands here allow administrators to validate the integrity of configuration files.`)
func NewCommandValidate(name, fullName string, out, errOut io.Writer) *cobra.Command {
// Parent command to which all subcommands are added.
cmds := &cobra.Command{
Use: name,
Short: "Validate configuration file integrity",
Long: validateLong,
Deprecated: validateDeprecationMessage,
Run: cmdutil.DefaultSubCommandRun(errOut),
}
cmds.AddCommand(NewCommandValidateMasterConfig(ValidateMasterConfigRecommendedName,
fullName+" "+ValidateMasterConfigRecommendedName, out))
cmds.AddCommand(NewCommandValidateNodeConfig(ValidateNodeConfigRecommendedName,
fullName+" "+ValidateNodeConfigRecommendedName, out))
return cmds
}