controller

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: AGPL-3.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelMdaiHubName               = "mdaihub-name" // Replace with your actual label key
	VariableKeyPrefix              = "variable/"
	DefaultValkeyAuditStreamExpiry = 30 * 24 * time.Hour
)
View Source
const (
	HubComponentLabel = "mdai-hub-component"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HubAdapter

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

func NewHubAdapter

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

type MDAILogStream

type MDAILogStream string
const (
	MdaiCollectorHubComponent = "mdai-collector"

	AuditLogstream     MDAILogStream = "audit"
	CollectorLogstream MDAILogStream = "collector"
	HubLogstream       MDAILogStream = "hub"
	OtherLogstream     MDAILogStream = "other"

	S3PartitionFormat = "%Y/%m/%d/%H"
)

type MdaiCollectorAdapter

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

func NewMdaiCollectorAdapter

func NewMdaiCollectorAdapter(
	cr *mdaiv1.MdaiCollector,
	log logr.Logger,
	client 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) MdaiCollectorReconcileHandler

func (r *MdaiCollectorReconciler) MdaiCollectorReconcileHandler(ctx context.Context, adapter MdaiCollectorAdapter) (ctrl.Result, error)

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) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type MdaiHubReconciler

type MdaiHubReconciler struct {
	client.Client
	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 (r *MdaiHubReconciler) ReconcileHandler(ctx context.Context, adapter HubAdapter) (ctrl.Result, error)

func (*MdaiHubReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ObjectState

type ObjectState bool
const (
	ObjectModified  ObjectState = true
	ObjectUnchanged ObjectState = false
)

type OperationResult

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

func ContinueOperationResult

func ContinueOperationResult() OperationResult

func ContinueProcessing

func ContinueProcessing() (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)

type S3ExporterConfig

type S3ExporterConfig struct {
	S3Uploader S3UploaderConfig `mapstructure:"s3uploader"`
}

type S3UploaderConfig

type S3UploaderConfig struct {
	Region            string `yaml:"region"`
	S3Bucket          string `yaml:"s3_bucket"`
	S3Prefix          string `yaml:"s3_prefix"`
	S3PartitionFormat string `yaml:"s3_partition_format"`
	FilePrefix        string `yaml:"file_prefix"`
	DisableSSL        bool   `yaml:"disable_ssl"`
}

Jump to

Keyboard shortcuts

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