lms

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReadyConditionType         string = "Ready"
	MoodleReadyConditionType   string = "MoodleReady"
	NfsReadyConditionType      string = "NfsReady"
	KeydbReadyConditionType    string = "KeydbReady"
	PostgresReadyConditionType string = "PostgresReady"
)
View Source
const (
	LMSMoodleNamePrefix        string = "lms-"
	LMSMoodleFinalizer         string = "lms.krestomat.io/finalizer"
	LMSMoodleTemplateNameIndex string = "spec.lmsMoodleTemplate"
	TruncateCharactersInName   int    = 17
)
View Source
const (
	LMSMoodleTemplateFinalizer string = "lms.krestomat.io/finalizer"
)
View Source
const (
	OPERATORNAME string = "lms-moodle-operator"
)

Variables

This section is empty.

Functions

func FindConditionUnstructuredByType

func FindConditionUnstructuredByType(conditionsUnstructured []interface{}, conditionType string) (map[string]interface{}, bool)

FindConditionUnstructuredByType returns first Condition with given conditionType along with bool flag which indicates if the Condition is found or not

func FindUsageItemUnstructuredByName

func FindUsageItemUnstructuredByName(usageUnstructured []interface{}, usageName string) (map[string]interface{}, bool)

FindUsageItemUnstructuredByName returns first usage item with given name along with bool flag which indicates if the usage item is found or not

func HasTransitioned

func HasTransitioned(oldCondition map[string]interface{}, newCondition map[string]interface{}) (map[string]interface{}, bool)

HasTransitioned returns the version of the condition and a bool flag. The values depends on whether its state has transitioned or not

func SetCondition

func SetCondition(unstructuredObj *unstructured.Unstructured, condition map[string]interface{}) (bool, error)

SetCondition update or append a condition if needed It returns a bool flag if condition was appended or updated, and any error

func SetStatusFromMoodle

func SetStatusFromMoodle(siteU *unstructured.Unstructured, moodleU *unstructured.Unstructured) (bool, error)

SetStatusFromMoodle set status keys from moodle CR in unstructure object It returns a bool flag if status from moodle was updated, and any error

func SetStatusState

func SetStatusState(objU *unstructured.Unstructured, state string) (bool, error)

SetStatusState set status state key in unstructure object It returns a bool flag if state was updated, and any error

Types

type LMSMoodleReconciler

type LMSMoodleReconciler struct {
	client.Client
	Scheme                                   *runtime.Scheme
	MoodleGVK, NfsGVK, KeydbGVK, PostgresGVK schema.GroupVersionKind
	// contains filtered or unexported fields
}

LMSMoodleReconciler reconciles a LMSMoodle object

func (*LMSMoodleReconciler) Reconcile

func (r *LMSMoodleReconciler) 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 LMSMoodle 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.19.0/pkg/reconcile

func (*LMSMoodleReconciler) ReconcileApply

func (r *LMSMoodleReconciler) ReconcileApply(ctx context.Context, parentObj client.Object, obj client.Object) error

func (*LMSMoodleReconciler) ReconcileCreate

func (r *LMSMoodleReconciler) ReconcileCreate(ctx context.Context, parentObj client.Object, obj client.Object) error

ReconcileCreate create resource if it does not exists. Otherwise it does nothing

func (*LMSMoodleReconciler) ReconcileDeleteDependant

func (r *LMSMoodleReconciler) ReconcileDeleteDependant(ctx context.Context, parentObj client.Object, obj client.Object) error

ReconcileDeleteDependant deletes a resource only if it has the owner reference of its parent

func (*LMSMoodleReconciler) ReconcileSetOwner

func (r *LMSMoodleReconciler) ReconcileSetOwner(ctx context.Context, parentObj client.Object, obj client.Object) error

func (*LMSMoodleReconciler) SetConditionFromDependantByType

func (r *LMSMoodleReconciler) SetConditionFromDependantByType(ctx context.Context, parentObj *unstructured.Unstructured, dependantObj *unstructured.Unstructured, parentConditionType string, dependantConditionType string) (changed bool, status bool)

SetConditionFromDependantByType set a condition in a parent object from a ready type condition of a dependant object based on its status Returns bool flag which indicates ready condition status of the dependant object

func (*LMSMoodleReconciler) SetFalseReadyCondition

func (r *LMSMoodleReconciler) SetFalseReadyCondition(ctx context.Context, reason string, message string) (changed bool, err error)

SetFalseReadyCondition set false ready condition

func (*LMSMoodleReconciler) SetKeydbReadyCondition

func (r *LMSMoodleReconciler) SetKeydbReadyCondition(ctx context.Context, parentObj *unstructured.Unstructured, dependantObj *unstructured.Unstructured) (changed bool, status bool)

SetKeydbReadyCondition set ready condition depending on ready status of Keydb and returns bool flag which indicates ready condition status of that dependant object

func (*LMSMoodleReconciler) SetMoodleReadyCondition

func (r *LMSMoodleReconciler) SetMoodleReadyCondition(ctx context.Context, parentObj *unstructured.Unstructured, dependantObj *unstructured.Unstructured) (changed bool, status bool)

SetMoodleReadyCondition set ready condition depending on ready status of Moodle and returns bool flag which indicates ready condition status of that dependant object

func (*LMSMoodleReconciler) SetNfsReadyCondition

func (r *LMSMoodleReconciler) SetNfsReadyCondition(ctx context.Context, parentObj *unstructured.Unstructured, dependantObj *unstructured.Unstructured) (changed bool, status bool)

SetNfsReadyCondition set ready condition depending on ready status of NFS Ganesha and returns bool flag which indicates ready condition status of that dependant object

func (*LMSMoodleReconciler) SetPostgresReadyCondition

func (r *LMSMoodleReconciler) SetPostgresReadyCondition(ctx context.Context, parentObj *unstructured.Unstructured, dependantObj *unstructured.Unstructured) (changed bool, status bool)

SetPostgresReadyCondition set ready condition depending on ready status of Postgres and returns bool flag which indicates ready condition status of that dependant object

func (*LMSMoodleReconciler) SetReadyCondition

func (r *LMSMoodleReconciler) SetReadyCondition(ctx context.Context, status string, reason string, message string) (changed bool, err error)

SetReadyCondition set ready condition

func (*LMSMoodleReconciler) SetSuccessfulReadyCondition

func (r *LMSMoodleReconciler) SetSuccessfulReadyCondition(ctx context.Context) (changed bool, err error)

SetSuccessfulReadyCondition set successful ready condition

func (*LMSMoodleReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type LMSMoodleReconcilerContext

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

type LMSMoodleTemplateInUsedError

type LMSMoodleTemplateInUsedError struct {
	Name            string // LMSMoodleTemplate name
	LMSMoodleNumber int    // Number of lms moodle using it
}

func (*LMSMoodleTemplateInUsedError) Error

type LMSMoodleTemplateNotFoundError

type LMSMoodleTemplateNotFoundError struct {
	Name string // LMSMoodleTemplate name
}

func (*LMSMoodleTemplateNotFoundError) Error

type LMSMoodleTemplateReconciler

type LMSMoodleTemplateReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

LMSMoodleTemplateReconciler reconciles a LMSMoodleTemplate object

func (*LMSMoodleTemplateReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the LMSMoodleTemplate 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.19.0/pkg/reconcile

func (*LMSMoodleTemplateReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type LMSMoodleTemplateReconcilerContext

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

Jump to

Keyboard shortcuts

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