Skip to content

Commit

Permalink
Implement feature request: a configuration file zegl#384
Browse files Browse the repository at this point in the history
  • Loading branch information
kmarteaux committed Mar 5, 2022
1 parent b9ba777 commit 1cbbcc8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmd/kube-score/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Actions:
score Checks all files in the input, and gives them a score and recommendations
list Prints a CSV list of all available score checks
version Print the version of kube-score
mkconfig Creates a .kube-score.yml configuration file from kube-score's registered checks in the current working directory
mkconfig Create a configuration file from kube-score's registered checks
help Print this message`+"\n\n", binName, binName)

if displayForMoreInfo {
Expand Down Expand Up @@ -158,22 +158,20 @@ Use "-" as filename to read from STDIN.`, execName(binName))
allFilePointers = append(allFilePointers, namedReader{Reader: fp, name: filename})
}

// load kube-score.yml configuration file (if present)
// load configuration file
cfg := loadConfigFile(*configFile)
excludeChks := excludeChecks(&cfg)
includeChks := includeChecks(&cfg)

fmt.Println("excludeChks <- ", excludeChks)
fmt.Println("includeChks <- ", includeChks)

*ignoreTests = append(*ignoreTests, excludeChks...)
*optionalTests = append(*optionalTests, includeChks...)

ignoredTests := listToStructMap(ignoreTests)
enabledOptionalTests := listToStructMap(optionalTests)

fmt.Println("ignoredTest <- ", ignoredTests)
fmt.Println("enabledOptionalTests <- ", optionalTests)
if cfg.DisableIgnoreChecksAnnotations {
disableIgnoreChecksAnnotation = &cfg.DisableIgnoreChecksAnnotations
}

kubeVer, err := config.ParseSemver(*kubernetesVersion)
if err != nil {
Expand Down

0 comments on commit 1cbbcc8

Please sign in to comment.