configtools

package
v1.67.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationResult

type ValidationResult struct {
	Settings map[string]interface{}
	Version  int

	Warning string
	Error   string
}

func (ValidationResult) HasError

func (v ValidationResult) HasError() bool

HasError return true if result has error. TODO(future) use regular error instead.

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator is a validator for values in ModuleConfig.

func NewValidator

func NewValidator(valuesValidator ValuesValidator) *Validator

func (*Validator) Validate

func (v *Validator) Validate(config *v1alpha1.ModuleConfig) ValidationResult

Validate checks ModuleConfig resource: - check if resource is well-formed - runs conversions for spec.settings if it`s needed - use OpenAPI schema defined in related config-values.yaml file to validate converted spec.settings. TODO(future) return cfg, error. Put cfg.Spec into result cfg.

type ValuesValidator

type ValuesValidator interface {
	GetGlobal() *modules.GlobalModule
	GetModule(name string) *modules.BasicModule
}

ValuesValidator is a part of ValuesValidator from addon-operator with needed methods to validate config values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL