controller

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const AnnotationValidationFailure = "AnnotationValidationFailure"

Variables

View Source
var ErrSkipReconciliation = errors.New("skip reconciliation")

Functions

This section is empty.

Types

type NamespaceScope

type NamespaceScope struct {
	client.Client
	// contains filtered or unexported fields
}

NamespaceScope defines the scope of operations for a specific namespace. It contains the client to interact with the Kubernetes API and the namespace name.

func NewNamespaceScope

func NewNamespaceScope(c client.Client, ns string) *NamespaceScope

NewNamespaceScope creates a new instance of NamespaceScope for the given namespace name.

func (*NamespaceScope) UpdateAnnotations

func (ss *NamespaceScope) UpdateAnnotations(
	ctx context.Context,
	objAnnotations map[string]string,
	object map[string]any,
) (map[string]string, error)

UpdateAnnotations updates the annotations of a namespace. It synchronizes annotations with the new ones, removes missing ones, and tracks last-applied annotations.

type UnstructuredReconciler

type UnstructuredReconciler struct {
	client.Client

	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
	// contains filtered or unexported fields
}

UnstructuredReconciler reconciles a Unstructured object

func (*UnstructuredReconciler) Reconcile

func (r *UnstructuredReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*UnstructuredReconciler) SetupWithManager

func (r *UnstructuredReconciler) SetupWithManager(mgr ctrl.Manager, gvk schema.GroupVersionKind) error

SetupWithManager sets up the controller with the Manager.

type ValidationError added in v0.3.0

type ValidationError struct {
	Key  string
	Errs []error
}

ValidationError represents an error associated with a specific key.

func NewValidationError added in v0.3.0

func NewValidationError(existing *ValidationError, key string, errs ...error) *ValidationError

NewValidationError creates a new ValidationError or appends errors to an existing one.

func (*ValidationError) AppendError added in v0.3.0

func (ve *ValidationError) AppendError(err error)

AppendError adds an error to the ValidationError.

func (*ValidationError) Message added in v0.3.0

func (ve *ValidationError) Message() string

Message formats the ValidationError into a readable string.

type ValidationErrors added in v0.3.0

type ValidationErrors struct {
	Items []*ValidationError
}

ValidationErrors represents a collection of validation errors.

func ValidateAnnotations added in v0.3.0

func ValidateAnnotations(annotations map[string]string) (map[string]string, *ValidationErrors)

func (*ValidationErrors) Error added in v0.3.0

func (ve *ValidationErrors) Error() string

Error formats all validation errors into a single string.

func (*ValidationErrors) Message added in v0.3.0

func (ve *ValidationErrors) Message() string

Jump to

Keyboard shortcuts

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