Documentation ¶
Index ¶
- Constants
- func Create(ctx context.Context, r Reconciler, parent, child client.Object) error
- func Delete(ctx context.Context, r Reconciler, obj client.Object)
- func GetCallerInfo(skip int) (fileName, funcName string, line int)
- func GetCallerLine() string
- func GetNextScheduleTime(obj metav1.Object, scheduler *v1alpha1.SchedulerSpec, ...) (lastMissed time.Time, next time.Time, err error)
- func IsManagedByThisController(obj metav1.Object, controller schema.GroupVersionKind) bool
- func LoadPlatformConfiguration(ctx context.Context, r Reconciler) (map[string]string, error)
- func MergeAnnotation(obj metav1.Object, add map[string]string)
- func MustGetGrafanaEndpoint(config map[string]string) string
- func PatchAnnotation(ctx context.Context, r Reconciler, cr client.Object, toAdd map[string]string) error
- func Reconcile(ctx context.Context, r Reconciler, req ctrl.Request, obj client.Object, ...) (ctrl.Result, error)
- func Requeue() (ctrl.Result, error)
- func RequeueAfter(delay time.Duration) (ctrl.Result, error)
- func RequeueWithError(err error) (ctrl.Result, error)
- func SetOwner(r Reconciler, parent, child metav1.Object)
- func Stop() (ctrl.Result, error)
- func Update(ctx context.Context, r Reconciler, obj client.Object) error
- func UpdateStatus(ctx context.Context, r Reconciler, obj client.Object) error
- type Reconciler
Constants ¶
const ( Hook = "app.frisbee.io/hook" BootHook = "boot" // PlatformConfiguration points to a configmap that maintain information about the installation. PlatformConfiguration = "platform-configuration" )
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create ignores existing objects. if the next reconciliation cycle happens faster than the API update, it is possible to reschedule the creation of a Job. To avoid that, get if the Job is already submitted.
func Delete ¶
func Delete(ctx context.Context, r Reconciler, obj client.Object)
Delete removes a Kubernetes object, ignoring the NotFound error. If any error exists, it is recorded in the reconciler's logger.
func GetCallerInfo ¶
func GetCallerLine ¶
func GetCallerLine() string
func GetNextScheduleTime ¶
func GetNextScheduleTime( obj metav1.Object, scheduler *v1alpha1.SchedulerSpec, lastScheduleTime *metav1.Time, ) (lastMissed time.Time, next time.Time, err error)
GetNextScheduleTime figure out the next times that we need to create jobs at (or anything we missed).
We'll start calculating appropriate times from our last run, or the creation of the CronJob if we can't find a last run. This gets the time of next schedule after last scheduled and before now.
If there are too many missed runs, and we don't have any deadlines set, we'll bail so that we don't cause issues on controller restarts or wedges. Otherwise, we'll just return the missed runs (of which we'll just use the latest), and the next run, so that we can know when it's time to reconcile again.
func IsManagedByThisController ¶
func IsManagedByThisController(obj metav1.Object, controller schema.GroupVersionKind) bool
IsManagedByThisController returns true if the object is managed by the specified controller. If it is managed by another controller, or no controller is being resolved, it returns false.
func LoadPlatformConfiguration ¶ added in v1.0.9
LoadPlatformConfiguration loads the platform configuration. The configuration must be pre-installed in the platform-configuration config map. (see chart/platform).
func MustGetGrafanaEndpoint ¶ added in v1.0.9
func PatchAnnotation ¶
func Reconcile ¶
func Reconcile(ctx context.Context, r Reconciler, req ctrl.Request, obj client.Object, returnNow *bool) (ctrl.Result, error)
Reconcile provides the most common functions for all the Reconcilers. That includes acquisition of the CR object
and management of the CR (Custom Resource) finalizers.
Bool indicate whether the caller should return immediately (true) or continue (false). The reconciliation cycle is where the framework gives us back control after a watch has passed up an event.
func RequeueAfter ¶
RequeueAfter will place the request in a queue, but it will be dequeue after the specified period.
func RequeueWithError ¶
RequeueWithError will place the request in a queue, and will be immediately dequeued. State dequeuing the request, the controller will report the error.
func SetOwner ¶
func SetOwner(r Reconciler, parent, child metav1.Object)
SetOwner is a helper method to make sure the given object contains an object reference to the object provided. This behavior is instrumental to guarantee correct garbage collection of resources especially when resources control other resources in a multilevel hierarchy (think deployment-> repilcaset->pod).
func Update ¶
Update will update the metadata and the spec of the Object. If there is a conflict, it will retry again.
func UpdateStatus ¶
UpdateStatus will update the status of the Object. If there is a conflict, it will retry again.
Types ¶
type Reconciler ¶
type Reconciler interface { GetClient() client.Client GetCache() cache.Cache logr.Logger Finalizer() string // Finalize deletes any external resources associated with the service // Examples finalizers include performing backups and deleting // resources that are not owned by this CR, like a PVC. // // Ensure that delete implementation is idempotent and safe to invoke // multiple times for same object Finalize(object client.Object) error }
Reconciler implements basic functionality that is common to every solid reconciler (e.g, finalizers)