controllers

package
v0.0.0-...-9b2ac06 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Devices = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "devices",
		Help: "Total number of devices",
	})
	AvailableDevices = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "devices_available",
		Help: "Total number of devices",
	})
	ReadyDevices = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "devices_ready",
		Help: "Total number of devices",
	})
)

Functions

This section is empty.

Types

type KubeSerialReconciler

type KubeSerialReconciler struct {
	client.Client
	Scheme               *runtime.Scheme
	DeviceMonitorVersion string
	FS                   utils.FileSystem
	APIClient            api.API
}

KubeSerialReconciler reconciles a KubeSerial object.

func (*KubeSerialReconciler) Reconcile

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

+kubebuilder:rbac:groups=app.kubeserial.com,resources=kubeserials,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=app.kubeserial.com,resources=kubeserials/status,verbs=get;update;patch +kubebuilder:rbac:groups=app.kubeserial.com,resources=kubeserials/finalizers,verbs=update

func (*KubeSerialReconciler) ReconcileMonitor

func (r *KubeSerialReconciler) ReconcileMonitor(ctx context.Context, cr *appv1alpha1.KubeSerial, _ string) error

func (*KubeSerialReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ManagerScheduleRequestReconciler

type ManagerScheduleRequestReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	Namespace string
	FS        utils.FileSystem
	APIClient api.API
}

ManagerScheduleRequestReconciler reconciles a ManagerScheduleRequest object.

func (*ManagerScheduleRequestReconciler) Reconcile

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 (*ManagerScheduleRequestReconciler) ReconcileManager

ReconcileManager.

func (*ManagerScheduleRequestReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type SerialDeviceReconciler

type SerialDeviceReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	APIClient api.API
	Namespace string
	FS        utils.FileSystem
}

SerialDeviceReconciler reconciles a SerialDevice object.

func (*SerialDeviceReconciler) EnsureConditions

func (r *SerialDeviceReconciler) EnsureConditions(ctx context.Context, device *kubeserialv1alpha1.SerialDevice) error

EnsureConditions makes sure all conditions are available in resource.

func (*SerialDeviceReconciler) EnsureNoGatewayRunning

func (r *SerialDeviceReconciler) EnsureNoGatewayRunning(ctx context.Context, device *kubeserialv1alpha1.SerialDevice) error

func (*SerialDeviceReconciler) EnsureNoManagerRequested

func (r *SerialDeviceReconciler) EnsureNoManagerRequested(ctx context.Context, device *kubeserialv1alpha1.SerialDevice) error

EnsureNoManagerRequested makes sure there is no ManagerScheduleRequest for device.

func (*SerialDeviceReconciler) HandleDeviceAvailable

func (r *SerialDeviceReconciler) HandleDeviceAvailable(
	ctx context.Context,
	device *kubeserialv1alpha1.SerialDevice,
	_ logr.Logger,
) (reconcile.Result, error)

func (*SerialDeviceReconciler) HandleDeviceUnavailable

func (r *SerialDeviceReconciler) HandleDeviceUnavailable(
	ctx context.Context,
	device *kubeserialv1alpha1.SerialDevice,
	_ logr.Logger,
) (reconcile.Result, error)

func (*SerialDeviceReconciler) ManagerIsAvailable

func (r *SerialDeviceReconciler) ManagerIsAvailable(
	ctx context.Context,
	device *kubeserialv1alpha1.SerialDevice,
	req ctrl.Request,
) bool

ManagerIsAvailable checks if Manager object referenced by SerialDevice is available in the cluster.

func (*SerialDeviceReconciler) Reconcile

func (r *SerialDeviceReconciler) 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 (*SerialDeviceReconciler) RequestGateway

func (*SerialDeviceReconciler) RequestManager

RequestManager create ManagerScheduleRequest for device.

func (*SerialDeviceReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*SerialDeviceReconciler) ValidateDeviceManager

func (r *SerialDeviceReconciler) ValidateDeviceManager(
	ctx context.Context,
	device *kubeserialv1alpha1.SerialDevice,
	req reconcile.Request,
) (bool, error)

ValidateDeviceManager validates if device manaager config is valid and upadates device state in case it's not.

func (*SerialDeviceReconciler) ValidateDeviceReady

func (r *SerialDeviceReconciler) ValidateDeviceReady(
	ctx context.Context,
	device *kubeserialv1alpha1.SerialDevice,
	req reconcile.Request,
) error

ValidateDeviceReady validates if device config is ready to be used.

Jump to

Keyboard shortcuts

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