Documentation
¶
Index ¶
- Constants
- func FindConditionUnstructuredByType(conditionsUnstructured []interface{}, conditionType string) (map[string]interface{}, bool)
- func FindUsageItemUnstructuredByName(usageUnstructured []interface{}, usageName string) (map[string]interface{}, bool)
- func HasTransitioned(oldCondition map[string]interface{}, newCondition map[string]interface{}) (map[string]interface{}, bool)
- func SetCondition(unstructuredObj *unstructured.Unstructured, condition map[string]interface{}) (bool, error)
- func SetStatusFromMoodle(siteU *unstructured.Unstructured, moodleU *unstructured.Unstructured) (bool, error)
- func SetStatusState(objU *unstructured.Unstructured, state string) (bool, error)
- type LMSMoodleReconciler
- func (r *LMSMoodleReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *LMSMoodleReconciler) ReconcileApply(ctx context.Context, parentObj client.Object, obj client.Object) error
- func (r *LMSMoodleReconciler) ReconcileCreate(ctx context.Context, parentObj client.Object, obj client.Object) error
- func (r *LMSMoodleReconciler) ReconcileDeleteDependant(ctx context.Context, parentObj client.Object, obj client.Object) error
- func (r *LMSMoodleReconciler) ReconcileSetOwner(ctx context.Context, parentObj client.Object, obj client.Object) error
- func (r *LMSMoodleReconciler) SetConditionFromDependantByType(ctx context.Context, parentObj *unstructured.Unstructured, ...) (changed bool, status bool)
- func (r *LMSMoodleReconciler) SetFalseReadyCondition(ctx context.Context, reason string, message string) (changed bool, err error)
- func (r *LMSMoodleReconciler) SetKeydbReadyCondition(ctx context.Context, parentObj *unstructured.Unstructured, ...) (changed bool, status bool)
- func (r *LMSMoodleReconciler) SetMoodleReadyCondition(ctx context.Context, parentObj *unstructured.Unstructured, ...) (changed bool, status bool)
- func (r *LMSMoodleReconciler) SetNfsReadyCondition(ctx context.Context, parentObj *unstructured.Unstructured, ...) (changed bool, status bool)
- func (r *LMSMoodleReconciler) SetPostgresReadyCondition(ctx context.Context, parentObj *unstructured.Unstructured, ...) (changed bool, status bool)
- func (r *LMSMoodleReconciler) SetReadyCondition(ctx context.Context, status string, reason string, message string) (changed bool, err error)
- func (r *LMSMoodleReconciler) SetSuccessfulReadyCondition(ctx context.Context) (changed bool, err error)
- func (r *LMSMoodleReconciler) SetupWithManager(mgr ctrl.Manager) error
- type LMSMoodleReconcilerContext
- type LMSMoodleTemplateInUsedError
- type LMSMoodleTemplateNotFoundError
- type LMSMoodleTemplateReconciler
- type LMSMoodleTemplateReconcilerContext
Constants ¶
const ( ReadyConditionType string = "Ready" MoodleReadyConditionType string = "MoodleReady" NfsReadyConditionType string = "NfsReady" KeydbReadyConditionType string = "KeydbReady" PostgresReadyConditionType string = "PostgresReady" )
const ( LMSMoodleNamePrefix string = "lms-" LMSMoodleFinalizer string = "lms.krestomat.io/finalizer" LMSMoodleTemplateNameIndex string = "spec.lmsMoodleTemplate" TruncateCharactersInName int = 17 )
const (
LMSMoodleTemplateFinalizer string = "lms.krestomat.io/finalizer"
)
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 ¶
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 (*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 (*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 ¶
func (f *LMSMoodleTemplateInUsedError) Error() string
type LMSMoodleTemplateNotFoundError ¶
type LMSMoodleTemplateNotFoundError struct {
Name string // LMSMoodleTemplate name
}
func (*LMSMoodleTemplateNotFoundError) Error ¶
func (f *LMSMoodleTemplateNotFoundError) Error() string
type LMSMoodleTemplateReconciler ¶
type LMSMoodleTemplateReconciler struct {
client.Client
Scheme *runtime.Scheme
// contains filtered or unexported fields
}
LMSMoodleTemplateReconciler reconciles a LMSMoodleTemplate object
func (*LMSMoodleTemplateReconciler) Reconcile ¶
func (r *LMSMoodleTemplateReconciler) 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 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
}