diff --git a/pkg/config/config.go b/pkg/config/config.go index 79447eb..b7df0f4 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -63,6 +63,7 @@ func splitCSV(csvStr string) map[string]struct{} { valuesMap := map[string]struct{}{} for _, kind := range splitValues { + kind = strings.TrimSpace(kind) if len(kind) > 0 { valuesMap[kind] = struct{}{} } diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 9a184d5..22dbbe1 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -95,6 +95,30 @@ func TestFromFlags(t *testing.T) { RejectKinds: map[string]struct{}{}, }, }, + { + []string{"-skip", "a, b, c"}, + Config{ + Files: []string{}, + KubernetesVersion: "master", + NumberOfWorkers: 4, + OutputFormat: "text", + SchemaLocations: nil, + SkipKinds: map[string]struct{}{"a": {}, "b": {}, "c": {}}, + RejectKinds: map[string]struct{}{}, + }, + }, + { + []string{"-skip", "a,b, c"}, + Config{ + Files: []string{}, + KubernetesVersion: "master", + NumberOfWorkers: 4, + OutputFormat: "text", + SchemaLocations: nil, + SkipKinds: map[string]struct{}{"a": {}, "b": {}, "c": {}}, + RejectKinds: map[string]struct{}{}, + }, + }, { []string{"-summary", "-verbose", "file1", "file2"}, Config{