Documentation ¶
Index ¶
- Variables
- func ChartValuesFromReferences(ctx context.Context, client kubeclient.Client, namespace string, ...) (chartutil.Values, error)
- func DigestValues(algo digest.Algorithm, values chartutil.Values) digest.Digest
- func ReplacePathValue(values chartutil.Values, path string, value string) error
- func VerifyValues(digest digest.Digest, values chartutil.Values) bool
- type ErrValuesRefReason
- type ErrValuesReference
Constants ¶
This section is empty.
Variables ¶
var ( // ErrResourceNotFound signals the referenced values resource could not be // found. ErrResourceNotFound = errors.New("resource not found") // ErrKeyNotFound signals the key could not be found in the referenced // values resource. ErrKeyNotFound = errors.New("key not found") // ErrUnsupportedRefKind signals the values reference kind is not // supported. ErrUnsupportedRefKind = errors.New("unsupported values reference kind") // ErrValuesDataRead signals the referenced resource's values data could // not be read. ErrValuesDataRead = errors.New("failed to read values data") // ErrValueMerge signals a single value could not be merged into the // values. ErrValueMerge = errors.New("failed to merge value") // ErrUnknown signals the reason an error occurred is unknown. ErrUnknown = errors.New("unknown error") )
Functions ¶
func ChartValuesFromReferences ¶
func ChartValuesFromReferences(ctx context.Context, client kubeclient.Client, namespace string, values map[string]interface{}, refs ...v2.ValuesReference) (chartutil.Values, error)
ChartValuesFromReferences attempts to construct new chart values by resolving the provided references using the client, merging them in the order given. If provided, the values map is merged in last. Overwriting values from references. It returns the merged values, or an ErrValuesReference error.
func DigestValues ¶
DigestValues calculates the digest of the values using the provided algorithm. The caller is responsible for ensuring that the algorithm is supported.
func ReplacePathValue ¶
ReplacePathValue replaces the value at the dot notation path with the given value using Helm's string value parser using strvals.ParseInto. Single or double-quoted values are merged using strvals.ParseIntoString.
func VerifyValues ¶
VerifyValues verifies the digest of the values against the provided digest.
Types ¶
type ErrValuesRefReason ¶
type ErrValuesRefReason error
ErrValuesRefReason is the descriptive reason for an ErrValuesReference.
type ErrValuesReference ¶
type ErrValuesReference struct { // Reason for the values reference error. Nil equals ErrUnknown. // Can be used with Is to reason about a returned error: // err := &ErrValuesReference{Reason: ErrResourceNotFound, ...} // errors.Is(err, ErrResourceNotFound) Reason ErrValuesRefReason // Kind of the values reference the error is being reported for. Kind string // Name of the values reference the error is being reported for. Name types.NamespacedName // Key of the values reference the error is being reported for. Key string // Optional indicates if the error is being reported for an optional values // reference. Optional bool // Err contains the further error chain leading to this error, it can be // nil. Err error }
ErrValuesReference is returned by ChartValuesFromReferences
func NewErrValuesReference ¶
func NewErrValuesReference(name types.NamespacedName, ref v2.ValuesReference, reason ErrValuesRefReason, err error) *ErrValuesReference
NewErrValuesReference returns a new ErrValuesReference constructed from the provided values.
func (*ErrValuesReference) Error ¶
func (e *ErrValuesReference) Error() string
Error returns an error string constructed out of the state of ErrValuesReference.
func (*ErrValuesReference) Is ¶
func (e *ErrValuesReference) Is(target error) bool
Is returns if target == Reason, or target == Err. Can be used to Reason about a returned error:
err := &ErrValuesReference{Reason: ErrResourceNotFound, ...} errors.Is(err, ErrResourceNotFound)
func (*ErrValuesReference) Unwrap ¶
func (e *ErrValuesReference) Unwrap() error
Unwrap returns the wrapped Err.