Skip to content

Commit

Permalink
make it clear that folder locations must be mounted locally
Browse files Browse the repository at this point in the history
also remove some opionated validation. this is done by kubeconform, doesn't need to be done by us too
  • Loading branch information
djeebus committed Oct 21, 2024
1 parent 5274205 commit 734e5fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func init() {
newStringOpts().
withChoices("hide", "delete").
withDefault("hide"))
stringSliceFlag(flags, "schemas-location", "Sets schema locations to be used for every check request. Can be common paths inside the repos being checked or git urls in either git or http(s) format.")
stringSliceFlag(flags, "schemas-location", "Sets schema locations to be used for every check request. Can be a common path on the host or git urls in either git or http(s) format.")
boolFlag(flags, "enable-conftest", "Set to true to enable conftest policy checking of manifests.")
stringSliceFlag(flags, "policies-location", "Sets rego policy locations to be used for every check request. Can be common path inside the repos being checked or git urls in either git or http(s) format.",
newStringSliceOpts().
Expand Down
15 changes: 1 addition & 14 deletions pkg/checks/kubeconform/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,7 @@ func getSchemaLocations(ctr container.Container) []string {
}

// schemas configured globally
for _, schemasLocation := range cfg.SchemasLocations {
if strings.HasPrefix(schemasLocation, "http://") || strings.HasPrefix(schemasLocation, "https://") {
locations = append(locations, schemasLocation)
} else {
if _, err := os.Stat(schemasLocation); err != nil {
log.Warn().
Err(err).
Str("path", schemasLocation).
Msg("schemas location is invalid, skipping")
} else {
locations = append(locations, schemasLocation)
}
}
}
locations = append(locations, cfg.SchemasLocations...)

for index := range locations {
location := locations[index]
Expand Down

0 comments on commit 734e5fd

Please sign in to comment.