values

package
v1.77.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrantDefault added in v1.77.0

type GrantDefault struct {
	Path  []string
	Value string
}

GrantDefault carries a runtime-resolved default value for a settings property located at Path (dot-separated path from the values root). It is applied by the grantDefaultsTransformer only when the target field is absent or holds an empty string.

type Storage

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

Storage manages package values with layering, patching, and schema validation. It maintains both the user config (before merging) and the final result after all layers.

Thread Safety: Protected by mutex for concurrent access.

func NewStorage

func NewStorage(name string, staticValues addonutils.Values, settingsBytes, valuesBytes []byte) (*Storage, error)

NewStorage creates a new values storage with the specified schemas and static values. It initializes the schema storage for validation and calculates initial result values.

Parameters:

  • name: Package name (will be converted to values key format)
  • staticValues: Pre-loaded static values from values.yaml
  • settingsBytes: OpenAPI config schema (YAML bytes)
  • valuesBytes: OpenAPI values schema (YAML bytes)

Returns error if schema initialization or initial value calculation fails.

func (*Storage) ApplySettings added in v1.76.1

func (s *Storage) ApplySettings(settings addonutils.Values) error

ApplySettings validates and saves user-defined config values. After saving, recalculates the result values with all layers merged.

func (*Storage) ApplySettingsDefaults added in v1.76.1

func (s *Storage) ApplySettingsDefaults(settings addonutils.Values) addonutils.Values

ApplySettingsDefaults returns a copy of the provided values with defaults from the config OpenAPI schema applied. Does not modify stored values.

func (*Storage) ApplyValuesPatch

func (s *Storage) ApplyValuesPatch(patch addonutils.ValuesPatch) error

ApplyValuesPatch applies a JSON patch to the result values. Patches are accumulated and reapplied on each recalculation. Used by hooks to dynamically modify values at runtime.

func (*Storage) ApplyValuesPatchWithLegacyRoot added in v1.77.0

func (s *Storage) ApplyValuesPatchWithLegacyRoot(patch addonutils.ValuesPatch) error

ApplyValuesPatchWithLegacyRoot applies a patch after unwrapping the legacy package-name root.

func (*Storage) GetSettings added in v1.76.0

func (s *Storage) GetSettings() addonutils.Values

GetSettings returns config values with config-schema defaults applied. Available in templates as .Application.Settings or .Module.Settings.

func (*Storage) GetSettingsChecksum added in v1.76.1

func (s *Storage) GetSettingsChecksum() string

GetSettingsChecksum returns a checksum of only the user-defined config values. Unlike GetValuesChecksum, this excludes static values, schema defaults, and patches.

func (*Storage) GetValues

func (s *Storage) GetValues() addonutils.Values

GetValues returns the final merged values that hooks and templates see. This includes all layers: static values, schema defaults, user config, and patches.

func (*Storage) GetValuesChecksum

func (s *Storage) GetValuesChecksum() string

GetValuesChecksum returns a checksum of the final merged values. Used to detect when values have changed (e.g., for triggering hook reruns).

func (*Storage) GrantRefs added in v1.77.0

func (s *Storage) GrantRefs() ([]schema.GrantRef, error)

GrantRefs returns the x-deckhouse-grantable-resource references declared in the settings schema. Returns nil when no settings schema or no such references exist.

func (*Storage) InjectRegistryValue added in v1.77.0

func (s *Storage) InjectRegistryValue(registry registry.Remote)

InjectRegistryValue sets the registry value in the static values TODO(ipaqsa): get rid of it after migration to module v2

func (*Storage) SetGrantDefaults added in v1.77.0

func (s *Storage) SetGrantDefaults(defaults []GrantDefault)

SetGrantDefaults stores the runtime-resolved grant defaults for subsequent injection via the grantDefaultsTransformer in GetSettings() and calculateResultValues().

func (*Storage) ValidateSettings added in v1.76.1

func (s *Storage) ValidateSettings(settings addonutils.Values) error

ValidateSettings validates values against the config OpenAPI schema. Does not modify the stored values - use ApplySettings to persist.

Directories

Path Synopsis
cel

Jump to

Keyboard shortcuts

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