From c6526d727846a4c795534501895a7fdaf989c6e7 Mon Sep 17 00:00:00 2001 From: Yann Hamon Date: Sun, 31 May 2020 04:36:29 +0200 Subject: [PATCH] Default to non-strict --- Readme.md | 2 ++ main.go | 4 ++-- pkg/output/text.go | 2 +- pkg/validator/main.go | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index 25b2b22..1b7a6e4 100644 --- a/Readme.md +++ b/Readme.md @@ -19,6 +19,8 @@ Usage of ./bin/kubeconform: output format - text, json (default "text") -printsummary print a summary at the end + -quiet + quiet output - only print invalid files, and errors -schema value file containing an additional Schema (can be specified multiple times) -skipKinds string diff --git a/main.go b/main.go index 88abc1f..9cc813a 100644 --- a/main.go +++ b/main.go @@ -97,12 +97,12 @@ func realMain() int { var nWorkers int var quiet bool - flag.BoolVar(&printSummary, "printsummary", false, "print a summary at the end") + flag.StringVar(&k8sVersion, "k8sversion", "1.18.0", "version of Kubernetes to test against") flag.Var(&files, "file", "file to validate (can be specified multiple times)") flag.Var(&dirs, "dir", "directory to validate (can be specified multiple times)") flag.Var(&schemas, "schema", "file containing an additional Schema (can be specified multiple times)") + flag.BoolVar(&printSummary, "printsummary", false, "print a summary at the end") flag.IntVar(&nWorkers, "workers", 4, "number of routines to run in parallel") - flag.StringVar(&k8sVersion, "k8sversion", "1.18.0", "version of Kubernetes to test against") flag.StringVar(&skipKinds, "skipKinds", "", "comma-separated list of kinds to ignore") flag.BoolVar(&strict, "strict", false, "activate strict mode") flag.StringVar(&outputFormat, "output", "text", "output format - text, json") diff --git a/pkg/output/text.go b/pkg/output/text.go index 47af997..d8dc921 100644 --- a/pkg/output/text.go +++ b/pkg/output/text.go @@ -35,7 +35,7 @@ func (o *TextOutput) Write(filename string, err error, skipped bool) { } o.nValid++ case s == INVALID: - fmt.Printf("%s - invalid resource: %s\n",filename, err) + fmt.Printf("%s - invalid resource: %s\n", filename, err) o.nInvalid++ case s == ERROR: fmt.Printf("%s - failed validating resource: %s\n", filename, err) diff --git a/pkg/validator/main.go b/pkg/validator/main.go index b79aa31..d68f82d 100644 --- a/pkg/validator/main.go +++ b/pkg/validator/main.go @@ -51,7 +51,7 @@ func Validate(rawResource []byte, schema *gojsonschema.Schema) error { if msg != "" { msg += " - " } - msg += errMsg.Description() + msg += errMsg.Description() } return InvalidResourceError{err: msg} }