mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-24 12:17:01 +00:00
opts should not be a pointer
This commit is contained in:
parent
649c2ca4d6
commit
9936e43d47
3 changed files with 4 additions and 4 deletions
|
|
@ -65,7 +65,7 @@ func realMain() int {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
v := validator.New(cfg.SchemaLocations, &validator.Opts{
|
v := validator.New(cfg.SchemaLocations, validator.Opts{
|
||||||
SkipTLS: cfg.SkipTLS,
|
SkipTLS: cfg.SkipTLS,
|
||||||
SkipKinds: cfg.SkipKinds,
|
SkipKinds: cfg.SkipKinds,
|
||||||
RejectKinds: cfg.RejectKinds,
|
RejectKinds: cfg.RejectKinds,
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Validator struct {
|
type Validator struct {
|
||||||
opts *Opts
|
opts Opts
|
||||||
schemaCache *cache.SchemaCache
|
schemaCache *cache.SchemaCache
|
||||||
schemaDownload func(registries []registry.Registry, kind, version, k8sVersion string) (*gojsonschema.Schema, error)
|
schemaDownload func(registries []registry.Registry, kind, version, k8sVersion string) (*gojsonschema.Schema, error)
|
||||||
regs []registry.Registry
|
regs []registry.Registry
|
||||||
|
|
@ -58,7 +58,7 @@ func downloadSchema(registries []registry.Registry, kind, version, k8sVersion st
|
||||||
return nil, nil // No schema found - we don't consider it an error, resource will be skipped
|
return nil, nil // No schema found - we don't consider it an error, resource will be skipped
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(schemaLocations []string, opts *Opts) *Validator {
|
func New(schemaLocations []string, opts Opts) *Validator {
|
||||||
registries := []registry.Registry{}
|
registries := []registry.Registry{}
|
||||||
for _, schemaLocation := range schemaLocations {
|
for _, schemaLocation := range schemaLocations {
|
||||||
registries = append(registries, registry.New(schemaLocation, opts.Strict, opts.SkipTLS))
|
registries = append(registries, registry.New(schemaLocation, opts.Strict, opts.SkipTLS))
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ lastName: bar
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
v := Validator{
|
v := Validator{
|
||||||
opts: &Opts{
|
opts: Opts{
|
||||||
SkipKinds: map[string]bool{},
|
SkipKinds: map[string]bool{},
|
||||||
RejectKinds: map[string]bool{},
|
RejectKinds: map[string]bool{},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue