utils

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsBytes

func AsBytes(v map[string]any, format string) ([]byte, error)

func DecodePatch

func DecodePatch(buf []byte) (patch.Patch, error)

DecodePatch decodes the passed JSON document as an RFC 6902 patch.

func FromUnstructured

func FromUnstructured(unstructuredObj *unstructured.Unstructured, obj any) error

func ModuleNameFromValuesKey

func ModuleNameFromValuesKey(moduleValuesKey string) string

ModuleNameFromValuesKey returns kebab-cased name from camelCased (verySimpleModule become very-simple-module)

func ModuleNameToValuesKey

func ModuleNameToValuesKey(moduleName string) string

ModuleNameToValuesKey returns camelCased name from kebab-cased (very-simple-module become verySimpleModule)

func NewValuesFromBytes

func NewValuesFromBytes(data []byte) (map[string]any, error)

NewValuesFromBytes loads values sections from maps in yaml or json format

func ToUnstructured

func ToUnstructured(obj any) (*unstructured.Unstructured, error)

func YamlBytes

func YamlBytes(v map[string]any) ([]byte, error)

Types

type ValuesPatchOperation

type ValuesPatchOperation struct {
	Op    string          `json:"op,omitempty"`
	Path  string          `json:"path,omitempty"`
	Value json.RawMessage `json:"value,omitempty"`
}

func (*ValuesPatchOperation) ToJSONPatch

func (op *ValuesPatchOperation) ToJSONPatch() (patch.Patch, error)

ToJSONPatch returns a jsonpatch.Patch with one operation.

func (*ValuesPatchOperation) ToString

func (op *ValuesPatchOperation) ToString() string

type ValuesPatchType

type ValuesPatchType string
const (
	ConfigMapPatch    ValuesPatchType = "CONFIG_MAP_PATCH"
	MemoryValuesPatch ValuesPatchType = "MEMORY_VALUES_PATCH"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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