Files
polaris/pkg/validator/custom.go
Vitor Rodrigo Vezani 952b6aed65 INSIGHTS-157 - PDB <> HPA check (#1057)
* fix typo

* fix failure message

* fix changelog

* fix missingPodDisruptionBudget validation

* add tests for pdbMinAvailableLessThenHPAMaxReplicas

* add simple success test

* fix typo

* lowercasing warnings

* WIP implement pdbMinAvailableLessThanHPAMaxReplicas

* change check name

* rename testes

* fix check message

* change check name

* minor fixes

* improving tests

* improve tests

* fix check name

* Update docs/checks/reliability.md

Co-authored-by: Andy Suderman <andy@fairwinds.com>

* fix/add tests

* fixes from PR

* fix error message

---------

Co-authored-by: Andy Suderman <andy@fairwinds.com>
2024-07-08 14:47:54 -03:00

20 lines
372 B
Go

package validator
import (
"sync"
"github.com/qri-io/jsonschema"
)
type validatorFunction func(test schemaTestCase) (bool, []jsonschema.ValError, error)
var validatorMapper = map[string]validatorFunction{}
var lock = &sync.Mutex{}
func registerCustomChecks(name string, check validatorFunction) {
lock.Lock()
defer lock.Unlock()
validatorMapper[name] = check
}