mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
Support providing custom Registries
This commit is contained in:
parent
f0a7d5203d
commit
1a48e38ede
1 changed files with 2 additions and 1 deletions
|
|
@ -61,6 +61,7 @@ type Opts struct {
|
|||
KubernetesVersion string // Kubernetes Version - has to match one in https://github.com/instrumenta/kubernetes-json-schema
|
||||
Strict bool // thros an error if resources contain undocumented fields
|
||||
IgnoreMissingSchemas bool // skip a resource if no schema for that resource can be found
|
||||
Registries []registry.Registry // Custom Registries to include for accessing schemas.
|
||||
}
|
||||
|
||||
// New returns a new Validator
|
||||
|
|
@ -71,7 +72,7 @@ func New(schemaLocations []string, opts Opts) (Validator, error) {
|
|||
schemaLocations = []string{"https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{{ .NormalizedKubernetesVersion }}-standalone{{ .StrictSuffix }}/{{ .ResourceKind }}{{ .KindSuffix }}.json"}
|
||||
}
|
||||
|
||||
registries := []registry.Registry{}
|
||||
registries := opts.Registries
|
||||
for _, schemaLocation := range schemaLocations {
|
||||
reg, err := registry.New(schemaLocation, opts.Cache, opts.Strict, opts.SkipTLS, opts.Debug)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue