Skip to content

Commit

Permalink
add shorthand for providing schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Ryan committed Aug 7, 2019
1 parent 805845b commit 192b1f1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kubeval/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ type Config struct {
FileName string
}


// NewDefaultConfig creates a Config with default values
func NewDefaultConfig() *Config {
return &Config{
FileName: "stdin",
FileName: "stdin",
KubernetesVersion: "master",
}
}
Expand All @@ -59,7 +58,7 @@ func AddKubevalFlags(cmd *cobra.Command, config *Config) *cobra.Command {
cmd.Flags().BoolVar(&config.Strict, "strict", false, "Disallow additional properties not in schema")
cmd.Flags().StringVarP(&config.FileName, "filename", "f", "stdin", "filename to be displayed when testing manifests read from stdin")
cmd.Flags().StringSliceVar(&config.KindsToSkip, "skip-kinds", []string{}, "Comma-separated list of case-sensitive kinds to skip when validating against schemas")
cmd.Flags().StringVar(&config.SchemaLocation, "schema-location", "", "Base URL used to download schemas. Can also be specified with the environment variable KUBEVAL_SCHEMA_LOCATION")
cmd.Flags().StringVarP(&config.SchemaLocation, "schema-location", "s", "", "Base URL used to download schemas. Can also be specified with the environment variable KUBEVAL_SCHEMA_LOCATION.")
cmd.Flags().StringVarP(&config.KubernetesVersion, "kubernetes-version", "v", "master", "Version of Kubernetes to validate against")
return cmd
}

0 comments on commit 192b1f1

Please sign in to comment.