Documentation
¶
Index ¶
- Constants
- Variables
- func AcquireInstanceMaintenanceLock(ctx context.Context, k8sClient client.Client, inst *v1alpha1.Instance, ...) error
- func CloneMap(source map[string]string) map[string]string
- func IsPatchingStateMachineEntryCondition(enabledServices map[commonv1alpha1.Service]bool, ...) bool
- func ReleaseInstanceMaintenanceLock(ctx context.Context, k8sClient client.Client, inst *v1alpha1.Instance, ...) error
- type InstanceReconciler
Constants ¶
const ( InstanceReadyTimeout = 20 * time.Minute DatabaseInstanceReadyTimeoutSeeded = 20 * time.Minute DatabaseInstanceReadyTimeoutUnseeded = 60 * time.Minute // 60 minutes because it can take 50+ minutes to create an unseeded CDB )
const ( // StandbyReconcileInterval is the reconcile interval for a standby instance. StandbyReconcileInterval = time.Second * 60 )
Variables ¶
var CheckStatusInstanceFunc = controllers.CheckStatusInstanceFunc
Functions ¶
func AcquireInstanceMaintenanceLock ¶
func AcquireInstanceMaintenanceLock(ctx context.Context, k8sClient client.Client, inst *v1alpha1.Instance, owner string) error
AcquireInstanceMaintenanceLock gives caller an exclusive maintenance access to the specified instance object. 'inst' points to an existing instance object (will be updated after the call) 'owner' identifies the owning controller e.g. 'instancecontroller' Convention: If the call succeeds the caller can safely assume that it has exclusive access now. If the call fails the caller needs to retry acquiring the lock.
Function is idempotent, caller can acquire the lock multiple times.
Note: The call will commit the instance object to k8s (with all changes), updating the supplied 'inst' object and making all other references stale.
func ReleaseInstanceMaintenanceLock ¶
func ReleaseInstanceMaintenanceLock(ctx context.Context, k8sClient client.Client, inst *v1alpha1.Instance, owner string) error
ReleaseInstanceMaintenanceLock releases exclusive maintenance access to the specified instance object. 'inst' points to an existing instance object (will be updated after the call) 'owner' identifies the owning controller e.g. 'instancecontroller' Convention: If the call succeeds the caller can safely assume that lock was released. If the call fails the caller needs to retry releasing the lock.
Call is idempotent, caller can release it multiple times. If caller's not owning the lock the call will return success without affecting the ownership.
Note: The call will commit the instance object to k8s (with all changes), updating the supplied 'inst' object and making all other references stale.
Types ¶
type InstanceReconciler ¶
type InstanceReconciler struct { client.Client Log logr.Logger Scheme *runtime.Scheme Images map[string]string Recorder record.EventRecorder InstanceLocks *sync.Map DatabaseClientFactory controllers.DatabaseClientFactory }
InstanceReconciler reconciles an Instance object.
func (*InstanceReconciler) SetupWithManager ¶
func (r *InstanceReconciler) SetupWithManager(mgr ctrl.Manager) error