Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func YAMLDocLoader ¶
YAMLDocLoader loads a yaml document from either http or a file and converts it to json.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage holds compiled OpenAPI schemas for a package, keyed by Type. All schemas are pre-processed and ready for repeated validation calls.
func NewStorage ¶
NewStorage parses settings and values YAML schema documents, applies the required transformations, and returns a Storage ready for use.
func (*Storage) Validate ¶
Validate validates values against the schema registered for valuesType. It extracts the value under root and runs both CEL rule checks and JSON-Schema validation. Transition rules referencing oldSelf are skipped because no previous values are provided; use ValidateTransition for that. Returns nil if no schema is registered for valuesType.
func (*Storage) ValidateTransition ¶
func (s *Storage) ValidateTransition(valuesType Type, root string, values, oldValues utils.Values) error
ValidateTransition is like Validate but additionally accepts the previously stored values, enabling x-deckhouse-validations transition rules (rules that reference oldSelf) to fire on updates. Pass oldValues=nil for the initial create / when previous values are not available.
type Type ¶
type Type string
Type identifies which schema variant is used for a given validation context.
const ( // TypeSettings is the schema for user-supplied configuration values (config.yaml). TypeSettings Type = "config" // TypeValues is the schema for the full set of internal module values. TypeValues Type = "values" // TypeHelm is derived from TypeValues with x-required-for-helm fields promoted to // required, making those fields mandatory during Helm chart rendering. TypeHelm Type = "helm" )