mirror of
https://github.com/yannh/kubeconform.git
synced 2026-04-19 18:29:52 +00:00
Add debug information to help understand failures finding schemas (#133)
* Add debug information to help understand failures finding schemas * Add debug information to help understand failures finding schemas
This commit is contained in:
parent
3cb76bc5e6
commit
f68d6ec6ea
9 changed files with 67 additions and 24 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
type Config struct {
|
||||
Cache string
|
||||
CPUProfileFile string
|
||||
Debug bool
|
||||
ExitOnError bool
|
||||
Files []string
|
||||
SchemaLocations []string
|
||||
|
|
@ -67,6 +68,7 @@ func FromFlags(progName string, args []string) (Config, string, error) {
|
|||
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(&rejectKindsCSV, "reject", "", "comma-separated list of kinds to reject")
|
||||
flags.BoolVar(&c.Debug, "debug", false, "print debug information")
|
||||
flags.BoolVar(&c.ExitOnError, "exit-on-error", false, "immediately stop execution when the first error is encountered")
|
||||
flags.BoolVar(&c.IgnoreMissingSchemas, "ignore-missing-schemas", false, "skip files with missing schemas instead of failing")
|
||||
flags.Var(&ignoreFilenamePatterns, "ignore-filename-pattern", "regular expression specifying paths to ignore (can be specified multiple times)")
|
||||
|
|
|
|||
|
|
@ -112,9 +112,10 @@ func TestFromFlags(t *testing.T) {
|
|||
{
|
||||
[]string{"-cache", "cache", "-ignore-missing-schemas", "-kubernetes-version", "1.16.0", "-n", "2", "-output", "json",
|
||||
"-schema-location", "folder", "-schema-location", "anotherfolder", "-skip", "kinda,kindb", "-strict",
|
||||
"-reject", "kindc,kindd", "-summary", "-verbose", "file1", "file2"},
|
||||
"-reject", "kindc,kindd", "-summary", "-debug", "-verbose", "file1", "file2"},
|
||||
Config{
|
||||
Cache: "cache",
|
||||
Debug: true,
|
||||
Files: []string{"file1", "file2"},
|
||||
IgnoreMissingSchemas: true,
|
||||
KubernetesVersion: "1.16.0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue