addonutils

package
v1.78.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package addonutils is the single point where this repository depends on addon-operator's values machinery.

Everything here is a re-export: the types are aliases, so a value of Values is the very same type addon-operator's own API takes and returns and crosses that boundary with no conversion. Nothing changes at runtime, and nothing is meant to: the package exists so the dependency has one seam instead of fifty, and replacing the implementation later is a change to this file rather than to every caller.

Only the surface this repository actually uses is re-exported. Widen it when a caller needs more, rather than mirroring upstream wholesale — the narrower this file stays, the smaller the eventual replacement is.

Note that this is not yet a decoupling: addon-operator stays in the build regardless, since the package runtime still drives its module manager, hooks and schema validation.

Index

Constants

View Source
const (
	// GlobalValuesKey is the key the global values live under.
	GlobalValuesKey = utils.GlobalValuesKey

	// ValuesFileName is the name of a package's static values file.
	ValuesFileName = utils.ValuesFileName

	// MemoryValuesPatch is the patch a hook applies to the in-memory values,
	// as opposed to the configuration the user owns.
	MemoryValuesPatch = utils.MemoryValuesPatch

	// Strict fails a patch that addresses a path the value tree does not have.
	Strict = utils.Strict

	// IgnoreNonExistentPaths skips such an operation instead of failing.
	IgnoreNonExistentPaths = utils.IgnoreNonExistentPaths
)

Variables

This section is empty.

Functions

func CalculateStringsChecksum

func CalculateStringsChecksum(stringArr ...string) string

CalculateStringsChecksum returns a checksum over the given strings.

func DumpData

func DumpData(filePath string, data []byte) error

DumpData writes data to a file, creating the parent directories it needs.

func ModuleNameFromValuesKey

func ModuleNameFromValuesKey(moduleValuesKey string) string

ModuleNameFromValuesKey converts a camelCase values key back to the module name.

func ModuleNameToValuesKey

func ModuleNameToValuesKey(moduleName string) string

ModuleNameToValuesKey converts a module name to the camelCase key its values live under.

func ReadOpenAPIFiles

func ReadOpenAPIFiles(openAPIDir string) ([]byte, []byte, error)

ReadOpenAPIFiles reads a package's config-values and values schemas from its openapi directory.

func SplitToPaths

func SplitToPaths(dir string) []string

SplitToPaths splits a colon-separated list of directories.

func SymlinkInfo

func SymlinkInfo(path string, info os.FileInfo) (string, bool, error)

SymlinkInfo resolves a directory entry that may be a symlink, reporting the target and whether it is a directory.

Types

type ApplyPatchMode

type ApplyPatchMode = utils.ApplyPatchMode

ApplyPatchMode decides what happens when a patch addresses a path that the value tree does not have.

type Maintenance

type Maintenance = utils.Maintenance

Maintenance is a module's maintenance mode.

type ModuleConfig

type ModuleConfig = utils.ModuleConfig

ModuleConfig is a module's configuration as addon-operator's kube config manager holds it.

func NewModuleConfig

func NewModuleConfig(moduleName string, values Values) *ModuleConfig

NewModuleConfig returns a module configuration holding the given values.

type Patch

type Patch = utils.Patch

Patch is a raw list of JSON Patch operations, before it is bound to a particular value tree.

func JsonPatchFromBytes

func JsonPatchFromBytes(data []byte) (Patch, error)

JsonPatchFromBytes parses a raw JSON Patch document.

type Values

type Values = utils.Values

Values is a package's value tree: the user configuration merged with the defaults of its OpenAPI schema, as handed to hooks and Helm.

func ApplyValuesPatch

func ApplyValuesPatch(values Values, valuesPatch ValuesPatch, mode ApplyPatchMode) (Values, bool, error)

ApplyValuesPatch applies a patch to a value tree, reporting whether it changed anything.

func LoadValuesFileFromDir

func LoadValuesFileFromDir(dir string, strictModeEnabled bool) (Values, error)

LoadValuesFileFromDir reads a package's static values file.

func MergeValues

func MergeValues(values ...Values) Values

MergeValues deep-merges value trees, with later arguments winning.

func NewValuesFromBytes

func NewValuesFromBytes(data []byte) (Values, error)

NewValuesFromBytes parses a value tree from YAML.

type ValuesPatch

type ValuesPatch = utils.ValuesPatch

ValuesPatch is a set of JSON Patch operations a hook returned against a value tree.

func AppendValuesPatch

func AppendValuesPatch(valuesPatches []ValuesPatch, newValuesPatch ValuesPatch) []ValuesPatch

AppendValuesPatch adds a patch to a list, collapsing it into the previous one where it can.

func NewValuesPatch

func NewValuesPatch() *ValuesPatch

NewValuesPatch returns an empty patch to append operations to.

type ValuesPatchType

type ValuesPatchType = utils.ValuesPatchType

ValuesPatchType names the value tree a patch applies to.

Jump to

Keyboard shortcuts

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