Skip to content

Commit 734e5fd

Browse files
committed
make it clear that folder locations must be mounted locally
also remove some opionated validation. this is done by kubeconform, doesn't need to be done by us too
1 parent 5274205 commit 734e5fd

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func init() {
7979
newStringOpts().
8080
withChoices("hide", "delete").
8181
withDefault("hide"))
82-
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.")
82+
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.")
8383
boolFlag(flags, "enable-conftest", "Set to true to enable conftest policy checking of manifests.")
8484
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.",
8585
newStringSliceOpts().

pkg/checks/kubeconform/validate.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,7 @@ func getSchemaLocations(ctr container.Container) []string {
2828
}
2929

3030
// schemas configured globally
31-
for _, schemasLocation := range cfg.SchemasLocations {
32-
if strings.HasPrefix(schemasLocation, "http://") || strings.HasPrefix(schemasLocation, "https://") {
33-
locations = append(locations, schemasLocation)
34-
} else {
35-
if _, err := os.Stat(schemasLocation); err != nil {
36-
log.Warn().
37-
Err(err).
38-
Str("path", schemasLocation).
39-
Msg("schemas location is invalid, skipping")
40-
} else {
41-
locations = append(locations, schemasLocation)
42-
}
43-
}
44-
}
31+
locations = append(locations, cfg.SchemasLocations...)
4532

4633
for index := range locations {
4734
location := locations[index]

0 commit comments

Comments
 (0)