mirror of
https://github.com/FairwindsOps/polaris.git
synced 2026-05-20 08:04:58 +00:00
* 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>
20 lines
372 B
Go
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
|
|
}
|