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
- func CalculateStringsChecksum(stringArr ...string) string
- func DumpData(filePath string, data []byte) error
- func ModuleNameFromValuesKey(moduleValuesKey string) string
- func ModuleNameToValuesKey(moduleName string) string
- func ReadOpenAPIFiles(openAPIDir string) ([]byte, []byte, error)
- func SplitToPaths(dir string) []string
- func SymlinkInfo(path string, info os.FileInfo) (string, bool, error)
- type ApplyPatchMode
- type Maintenance
- type ModuleConfig
- type Patch
- type Values
- type ValuesPatch
- type ValuesPatchType
Constants ¶
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 ¶
CalculateStringsChecksum returns a checksum over the given strings.
func ModuleNameFromValuesKey ¶
ModuleNameFromValuesKey converts a camelCase values key back to the module name.
func ModuleNameToValuesKey ¶
ModuleNameToValuesKey converts a module name to the camelCase key its values live under.
func ReadOpenAPIFiles ¶
ReadOpenAPIFiles reads a package's config-values and values schemas from its openapi directory.
func SplitToPaths ¶
SplitToPaths splits a colon-separated list of directories.
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 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 ¶
Patch is a raw list of JSON Patch operations, before it is bound to a particular value tree.
func JsonPatchFromBytes ¶
JsonPatchFromBytes parses a raw JSON Patch document.
type 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 ¶
LoadValuesFileFromDir reads a package's static values file.
func MergeValues ¶
MergeValues deep-merges value trees, with later arguments winning.
func NewValuesFromBytes ¶
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.