Documentation ¶
Index ¶
- Variables
- func Create(ctx context.Context, reconciler Reconciler, parent, child client.Object) error
- func Delete(ctx context.Context, reconciler Reconciler, obj client.Object)
- func ExternalEndpoint(name, planName string) string
- func GenerateName(group metav1.Object, jobIndex int) string
- func InternalEndpoint(name string, planName string, port int64) string
- func IsManagedByThisController(obj metav1.Object, controller schema.GroupVersionKind) bool
- func ListChildren(ctx context.Context, reconciler Reconciler, childJobs client.ObjectList, ...) 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 Stop() (ctrl.Result, error)
- func Update(ctx context.Context, reconciler Reconciler, obj client.Object) error
- func UpdateStatus(ctx context.Context, reconciler Reconciler, obj client.Object) error
- type Reconciler
Constants ¶
This section is empty.
Variables ¶
var BackoffForK8sEndpoint = wait.Backoff{ Duration: 1 * time.Second, Factor: 5, Jitter: 0.1, Steps: 3, }
var BackoffForServiceEndpoint = wait.Backoff{ Duration: 5 * time.Second, Factor: 5, Jitter: 0.1, Steps: 3, }
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, reconciler 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 ExternalEndpoint ¶
ExternalEndpoint creates an endpoint for accessing the service outside the cluster.
func GenerateName ¶ added in v1.0.24
GenerateName names the children of a given resource. The instances will be named as Master-1, Master-2, ... see https://github.com/CARV-ICS-FORTH/frisbee/issues/339
func InternalEndpoint ¶
InternalEndpoint creates an endpoint for accessing the service within the cluster.
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 ListChildren ¶
func ListChildren(ctx context.Context, reconciler Reconciler, childJobs client.ObjectList, req types.NamespacedName) error
func Reconcile ¶
func Reconcile(ctx context.Context, r Reconciler, req ctrl.Request, obj client.Object, requeue *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 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 GetEventRecorderFor(name string) record.EventRecorder Error(err error, msg string, keysAndValues ...interface{}) Info(msg string, keysAndValues ...interface{}) V(level int) 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 EphemeralVolume. // // 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).