core

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 6 Imported by: 0

README

Genruntime/Core

This package contains simple shared declarations used across the generic reconciler and generated code.

Documentation

Index

Constants

View Source
const (
	ErrorRetryable = ErrorClassification("retryable")
	ErrorFatal     = ErrorClassification("fatal")
)
View Source
const (
	UnknownErrorCode    = "UnknownError"
	UnknownErrorMessage = "There was an unknown deployment error"
)

Variables

This section is empty.

Functions

func AsTypedError

func AsTypedError[T error](err error) (T, bool)

func NewNotOwnedError

func NewNotOwnedError(namespace string, name string, gvk schema.GroupVersionKind, sourceName string, sourceGvk schema.GroupVersionKind) error

Types

type CloudErrorDetails

type CloudErrorDetails struct {
	Classification ErrorClassification
	Code           string
	Message        string
}

type ConfigMapNotFound

type ConfigMapNotFound struct {
	NamespacedName types.NamespacedName
	// contains filtered or unexported fields
}

ConfigMapNotFound error is used when configmap or its expected keys are not found

func NewConfigMapNotFoundError

func NewConfigMapNotFoundError(name types.NamespacedName, cause error) *ConfigMapNotFound

func (*ConfigMapNotFound) Cause

func (e *ConfigMapNotFound) Cause() error

func (*ConfigMapNotFound) Error

func (e *ConfigMapNotFound) Error() string

func (*ConfigMapNotFound) Format

func (e *ConfigMapNotFound) Format(s fmt.State, verb rune)

func (*ConfigMapNotFound) Is

func (e *ConfigMapNotFound) Is(err error) bool

type DestinationExpression added in v2.10.0

type DestinationExpression struct {
	// Name is the name of the Kubernetes configmap or secret to write to.
	// The configmap or secret will be created in the same namespace as the resource.
	// +kubebuilder:validation:Required
	Name string `json:"name,omitempty"`

	// Key is the key in the ConfigMap or Secret being written to. If the CEL expression in Value returns a string
	// this is required to identify what key to write to. If the CEL expression in Value returns a map[string]string
	// Key must not be set, instead the keys written will be determined dynamically based on the keys of the resulting
	// map[string]string.
	Key string `json:"key,omitempty"`

	// Value is a CEL expression. The CEL expression may return a string or a map[string]string. For more information
	// on CEL in ASO see https://azure.github.io/azure-service-operator/guide/expressions/
	// +kubebuilder:validation:Required
	Value string `json:"value,omitempty"`
}

DestinationExpression is a CEL expression and a destination to store the result in. The destination may be a secret or a configmap. The value of the expression is stored at the specified location in the destination. +kubebuilder:object:generate=true

func (*DestinationExpression) DeepCopy added in v2.10.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationExpression.

func (*DestinationExpression) DeepCopyInto added in v2.10.0

func (in *DestinationExpression) DeepCopyInto(out *DestinationExpression)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (DestinationExpression) String added in v2.10.0

func (s DestinationExpression) String() string

type ErrorClassification

type ErrorClassification string

type NotOwnedError

type NotOwnedError struct {
	Namespace  string
	TargetName string
	TargetType string
	SourceName string
	SourceType string
}

NotOwnedError indicates the target resource is not owned by the resource attempting to write it

func AsNotOwnedError

func AsNotOwnedError(err error) (*NotOwnedError, bool)

func (*NotOwnedError) Error

func (e *NotOwnedError) Error() string

type ReferenceNotFound

type ReferenceNotFound struct {
	NamespacedName types.NamespacedName
	// contains filtered or unexported fields
}

func NewReferenceNotFoundError

func NewReferenceNotFoundError(name types.NamespacedName, cause error) *ReferenceNotFound

func (*ReferenceNotFound) Cause

func (e *ReferenceNotFound) Cause() error

func (*ReferenceNotFound) Error

func (e *ReferenceNotFound) Error() string

func (*ReferenceNotFound) Format

func (e *ReferenceNotFound) Format(s fmt.State, verb rune)

func (*ReferenceNotFound) Is

func (e *ReferenceNotFound) Is(err error) bool

type SecretNotFound

type SecretNotFound struct {
	NamespacedName types.NamespacedName
	// contains filtered or unexported fields
}

SecretNotFound error is used when secret or its expected keys are not found

func NewSecretNotFoundError

func NewSecretNotFoundError(name types.NamespacedName, cause error) *SecretNotFound

func (*SecretNotFound) Cause

func (e *SecretNotFound) Cause() error

func (*SecretNotFound) Error

func (e *SecretNotFound) Error() string

func (*SecretNotFound) Format

func (e *SecretNotFound) Format(s fmt.State, verb rune)

func (*SecretNotFound) Is

func (e *SecretNotFound) Is(err error) bool

type SubscriptionMismatch added in v2.3.0

type SubscriptionMismatch struct {
	ExpectedSubscription string
	ActualSubscription   string
	// contains filtered or unexported fields
}

SubscriptionMismatch error is used when a child resource and parent resource subscription don't match

func NewSubscriptionMismatchError added in v2.3.0

func NewSubscriptionMismatchError(expectedSub string, actualSub string) *SubscriptionMismatch

func (*SubscriptionMismatch) Cause added in v2.3.0

func (e *SubscriptionMismatch) Cause() error

func (*SubscriptionMismatch) Error added in v2.3.0

func (e *SubscriptionMismatch) Error() string

func (*SubscriptionMismatch) Format added in v2.3.0

func (e *SubscriptionMismatch) Format(s fmt.State, verb rune)

func (*SubscriptionMismatch) Is added in v2.3.0

func (e *SubscriptionMismatch) Is(err error) bool

Jump to

Keyboard shortcuts

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