controller

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: AGPL-3.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ObjectModified          ObjectState = true
	ObjectUnchanged         ObjectState = false
	LabelManagedByMdaiKey               = "app.kubernetes.io/managed-by"
	LabelManagedByMdaiValue             = "mdai-operator"
)
View Source
const (
	MdaiCollectorHubComponent = "mdai-collector"

	S3PartitionFormat = "%Y/%m/%d/%H"
)
View Source
const (
	LabelMdaiHubName               = "mydecisive.ai/hub-name" // Replace with your actual label key
	VariableKeyPrefix              = "variable/"
	DefaultValkeyAuditStreamExpiry = 30 * 24 * time.Hour
)
View Source
const (
	HubComponentLabel = "mydecisive.ai/hub-component"
)

Variables

This section is empty.

Functions

func BuildCollector added in v0.2.2

func BuildCollector(params manifests.Params) ([]client.Object, error)

BuildCollector returns the generation and collected errors of all manifests for a given instance.

func GetOwnedResourceTypes added in v0.2.2

func GetOwnedResourceTypes() []client.Object

GetOwnedResourceTypes returns all the resource types the controller can own. Even though this method returns an array of client.Object, these are (empty) example structs rather than actual resources.

Types

type Adapter added in v0.1.23

type Adapter interface {
	// contains filtered or unexported methods
}

type CMOption added in v0.1.23

type CMOption func(cm *corev1.ConfigMap) error

func WithOwnerRef added in v0.1.23

func WithOwnerRef(owner metav1.Object, scheme *runtime.Scheme) CMOption

type Controller added in v0.1.23

type Controller interface {
	Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
	ReconcileHandler(ctx context.Context, adapter Adapter) (ctrl.Result, error)
	SetupWithManager(mgr ctrl.Manager) error
}

type HubAdapter

type HubAdapter struct {
	// contains filtered or unexported fields
}

func NewHubAdapter

func NewHubAdapter(
	cr *mdaiv1.MdaiHub,
	log logr.Logger,
	zapLogger *zap.Logger,
	k8sClient client.Client,
	recorder record.EventRecorder,
	scheme *runtime.Scheme,
	valkeyClient valkey.Client,
	valkeyAuditStreamExpiry time.Duration,
) *HubAdapter

type MdaiCollectorAdapter

type MdaiCollectorAdapter struct {
	// contains filtered or unexported fields
}

func NewMdaiCollectorAdapter

func NewMdaiCollectorAdapter(
	cr *mdaiv1.MdaiCollector,
	log logr.Logger,
	k8sClient client.Client,
	recorder record.EventRecorder,
	scheme *runtime.Scheme,
) *MdaiCollectorAdapter

type MdaiCollectorReconciler

type MdaiCollectorReconciler struct {
	client.Client

	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

MdaiCollectorReconciler reconciles a MdaiCollector object

func (*MdaiCollectorReconciler) Reconcile

func (r *MdaiCollectorReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the MdaiCollector object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.20.4/pkg/reconcile

func (*MdaiCollectorReconciler) ReconcileHandler added in v0.1.23

func (*MdaiCollectorReconciler) ReconcileHandler(ctx context.Context, adapter Adapter) (ctrl.Result, error)

func (*MdaiCollectorReconciler) SetupWithManager

func (r *MdaiCollectorReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type MdaiHubReconciler

type MdaiHubReconciler struct {
	client.Client

	ZapLogger    *zap.Logger
	Scheme       *runtime.Scheme
	Recorder     record.EventRecorder
	ValKeyClient valkey.Client
	ValkeyEvents chan event.GenericEvent
	ValkeyExpiry time.Duration
}

MdaiHubReconciler reconciles a MdaiHub object

func (*MdaiHubReconciler) Reconcile

func (r *MdaiHubReconciler) 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.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1/pkg/reconcile

func (*MdaiHubReconciler) ReconcileHandler

func (*MdaiHubReconciler) ReconcileHandler(ctx context.Context, adapter Adapter) (ctrl.Result, error)

func (*MdaiHubReconciler) SetupWithManager

func (r *MdaiHubReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type MdaiIngressReconciler added in v0.2.2

type MdaiIngressReconciler struct {
	client.Client

	Scheme *runtime.Scheme
	Cache  cache.Cache
	Logger *zap.Logger
}

MdaiIngressReconciler reconciles a MdaiIngress object

func (*MdaiIngressReconciler) GetParams added in v0.2.2

func (r *MdaiIngressReconciler) GetParams(otelMdaiComb hubv1.OtelMdaiIngressComb) manifests.Params

func (*MdaiIngressReconciler) Reconcile added in v0.2.2

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

func (*MdaiIngressReconciler) SetupWithManager added in v0.2.2

func (r *MdaiIngressReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type MdaiObserverReconciler added in v0.1.21

type MdaiObserverReconciler struct {
	client.Client

	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

MdaiObserverReconciler reconciles a MdaiObserver object

func (*MdaiObserverReconciler) Reconcile added in v0.1.21

func (r *MdaiObserverReconciler) 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.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.20.2/pkg/reconcile

func (*MdaiObserverReconciler) ReconcileHandler added in v0.1.21

func (*MdaiObserverReconciler) ReconcileHandler(ctx context.Context, adapter Adapter) (ctrl.Result, error)

ReconcileHandler processes the MdaiObserver CR and performs the necessary operations.

func (*MdaiObserverReconciler) SetupWithManager added in v0.1.21

func (r *MdaiObserverReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ObjectState

type ObjectState bool

type ObserverAdapter added in v0.1.21

type ObserverAdapter struct {
	// contains filtered or unexported fields
}

func NewObserverAdapter added in v0.1.21

func NewObserverAdapter(
	cr *mdaiv1.MdaiObserver,
	log logr.Logger,
	k8sClient client.Client,
	recorder record.EventRecorder,
	scheme *runtime.Scheme,
) *ObserverAdapter

type OperationResult

type OperationResult struct {
	RequeueDelay   time.Duration
	RequeueRequest bool
	CancelRequest  bool
}

func ContinueOperationResult

func ContinueOperationResult() OperationResult

func ContinueProcessing

func ContinueProcessing() (OperationResult, error)

func ContinueWithError added in v0.1.23

func ContinueWithError(errIn error) (OperationResult, error)

func Requeue

func Requeue() (OperationResult, error)

func RequeueAfter

func RequeueAfter(delay time.Duration, errIn error) (OperationResult, error)

func RequeueOnErrorOrContinue

func RequeueOnErrorOrContinue(errIn error) (OperationResult, error)

func RequeueOnErrorOrStop

func RequeueOnErrorOrStop(errIn error) (OperationResult, error)

func RequeueWithError

func RequeueWithError(errIn error) (OperationResult, error)

func StopOperationResult

func StopOperationResult() OperationResult

func StopProcessing

func StopProcessing() (OperationResult, error)

func (OperationResult) RequeueOrCancel

func (r OperationResult) RequeueOrCancel() bool

type ReconcileOperation

type ReconcileOperation func(context.Context) (OperationResult, error)

Jump to

Keyboard shortcuts

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