mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-17 17:07:02 +00:00
Merge pull request #62 from yannh/use-master-by-default
Validate against master by default, not 1.18.0
This commit is contained in:
commit
f8ffb2f9e3
6 changed files with 1126 additions and 89 deletions
|
|
@ -75,7 +75,7 @@ Usage: ./bin/kubeconform [OPTION]... [FILE OR FOLDER]...
|
||||||
-insecure-skip-tls-verify
|
-insecure-skip-tls-verify
|
||||||
disable verification of the server's SSL certificate. This will make your HTTPS connections insecure
|
disable verification of the server's SSL certificate. This will make your HTTPS connections insecure
|
||||||
-kubernetes-version string
|
-kubernetes-version string
|
||||||
version of Kubernetes to validate against (default "1.18.0")
|
version of Kubernetes to validate against, e.g.: 1.18.0 (default "master")
|
||||||
-n int
|
-n int
|
||||||
number of goroutines to run concurrently (default 4)
|
number of goroutines to run concurrently (default 4)
|
||||||
-output string
|
-output string
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -63,7 +63,7 @@ func FromFlags(progName string, args []string) (Config, string, error) {
|
||||||
c := Config{}
|
c := Config{}
|
||||||
c.Files = []string{}
|
c.Files = []string{}
|
||||||
|
|
||||||
flags.StringVar(&c.KubernetesVersion, "kubernetes-version", "1.18.0", "version of Kubernetes to validate against")
|
flags.StringVar(&c.KubernetesVersion, "kubernetes-version", "master", "version of Kubernetes to validate against, e.g.: 1.18.0")
|
||||||
flags.Var(&schemaLocationsParam, "schema-location", "override schemas location search path (can be specified multiple times)")
|
flags.Var(&schemaLocationsParam, "schema-location", "override schemas location search path (can be specified multiple times)")
|
||||||
flags.StringVar(&skipKindsCSV, "skip", "", "comma-separated list of kinds to ignore")
|
flags.StringVar(&skipKindsCSV, "skip", "", "comma-separated list of kinds to ignore")
|
||||||
flags.StringVar(&rejectKindsCSV, "reject", "", "comma-separated list of kinds to reject")
|
flags.StringVar(&rejectKindsCSV, "reject", "", "comma-separated list of kinds to reject")
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ func TestFromFlags(t *testing.T) {
|
||||||
[]string{},
|
[]string{},
|
||||||
Config{
|
Config{
|
||||||
Files: []string{},
|
Files: []string{},
|
||||||
KubernetesVersion: "1.18.0",
|
KubernetesVersion: "master",
|
||||||
NumberOfWorkers: 4,
|
NumberOfWorkers: 4,
|
||||||
OutputFormat: "text",
|
OutputFormat: "text",
|
||||||
SchemaLocations: nil,
|
SchemaLocations: nil,
|
||||||
|
|
@ -62,7 +62,7 @@ func TestFromFlags(t *testing.T) {
|
||||||
Config{
|
Config{
|
||||||
Files: []string{},
|
Files: []string{},
|
||||||
Help: true,
|
Help: true,
|
||||||
KubernetesVersion: "1.18.0",
|
KubernetesVersion: "master",
|
||||||
NumberOfWorkers: 4,
|
NumberOfWorkers: 4,
|
||||||
OutputFormat: "text",
|
OutputFormat: "text",
|
||||||
SchemaLocations: nil,
|
SchemaLocations: nil,
|
||||||
|
|
@ -74,7 +74,7 @@ func TestFromFlags(t *testing.T) {
|
||||||
[]string{"-skip", "a,b,c"},
|
[]string{"-skip", "a,b,c"},
|
||||||
Config{
|
Config{
|
||||||
Files: []string{},
|
Files: []string{},
|
||||||
KubernetesVersion: "1.18.0",
|
KubernetesVersion: "master",
|
||||||
NumberOfWorkers: 4,
|
NumberOfWorkers: 4,
|
||||||
OutputFormat: "text",
|
OutputFormat: "text",
|
||||||
SchemaLocations: nil,
|
SchemaLocations: nil,
|
||||||
|
|
@ -86,7 +86,7 @@ func TestFromFlags(t *testing.T) {
|
||||||
[]string{"-summary", "-verbose", "file1", "file2"},
|
[]string{"-summary", "-verbose", "file1", "file2"},
|
||||||
Config{
|
Config{
|
||||||
Files: []string{"file1", "file2"},
|
Files: []string{"file1", "file2"},
|
||||||
KubernetesVersion: "1.18.0",
|
KubernetesVersion: "master",
|
||||||
NumberOfWorkers: 4,
|
NumberOfWorkers: 4,
|
||||||
OutputFormat: "text",
|
OutputFormat: "text",
|
||||||
SchemaLocations: nil,
|
SchemaLocations: nil,
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ func New(schemaLocation string, cache string, strict bool, skipTLS bool) (Regist
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to compile the schemaLocation template to ensure it is valid
|
// try to compile the schemaLocation template to ensure it is valid
|
||||||
if _, err := schemaPath(schemaLocation, "Deployment", "v1", "1.18.0", true); err != nil {
|
if _, err := schemaPath(schemaLocation, "Deployment", "v1", "master", true); err != nil {
|
||||||
return nil, fmt.Errorf("failed initialising schema location registry: %s", err)
|
return nil, fmt.Errorf("failed initialising schema location registry: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ func New(schemaLocations []string, opts Opts) (Validator, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.KubernetesVersion == "" {
|
if opts.KubernetesVersion == "" {
|
||||||
opts.KubernetesVersion = "1.18.0"
|
opts.KubernetesVersion = "master"
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.SkipKinds == nil {
|
if opts.SkipKinds == nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue