Compare commits
No commits in common. "aa76aa2128ea21461d591388d4afc76f73b1ea3e" and "04c6a55b1af77169fbe42c6df85bfb96a51de73a" have entirely different histories.
aa76aa2128
...
04c6a55b1a
@ -263,12 +263,7 @@ func (r *BackupConfigurationReconciler) addCronJob(backupConf *formolv1alpha1.Ba
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := formolrbac.CreateFormolRBAC(r.Client, "default", backupConf.Namespace); err != nil {
|
if err := formolrbac.CreateFormolRBAC(r.Client, "default", backupConf.Namespace); err != nil {
|
||||||
log.Error(err, "unable to create formol RBAC")
|
log.Error(err, "unable to create backupsessionlistener RBAC")
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := formolrbac.CreateBackupSessionCreatorRBAC(r.Client, backupConf.Namespace); err != nil {
|
|
||||||
log.Error(err, "unable to create backupsession creattor RBAC")
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -257,13 +257,6 @@ func (r *BackupSessionReconciler) Reconcile(req ctrl.Request) (ctrl.Result, erro
|
|||||||
log.Error(err, "unable to get backupsession")
|
log.Error(err, "unable to get backupsession")
|
||||||
return ctrl.Result{}, client.IgnoreNotFound(err)
|
return ctrl.Result{}, client.IgnoreNotFound(err)
|
||||||
}
|
}
|
||||||
r.BackupConf = &formolv1alpha1.BackupConfiguration{}
|
|
||||||
if err := r.Get(ctx, client.ObjectKey{
|
|
||||||
Namespace: r.BackupSession.Namespace,
|
|
||||||
Name: r.BackupSession.Spec.Ref.Name}, r.BackupConf); err != nil {
|
|
||||||
log.Error(err, "unable to get backupConfiguration")
|
|
||||||
return ctrl.Result{}, client.IgnoreNotFound(err)
|
|
||||||
}
|
|
||||||
log.V(0).Info("backupSession", "backupSession.ObjectMeta", r.BackupSession.ObjectMeta, "backupSession.Status", r.BackupSession.Status)
|
log.V(0).Info("backupSession", "backupSession.ObjectMeta", r.BackupSession.ObjectMeta, "backupSession.Status", r.BackupSession.Status)
|
||||||
if r.BackupSession.Status.ObservedGeneration == r.BackupSession.ObjectMeta.Generation {
|
if r.BackupSession.Status.ObservedGeneration == r.BackupSession.ObjectMeta.Generation {
|
||||||
// status update
|
// status update
|
||||||
@ -276,6 +269,14 @@ func (r *BackupSessionReconciler) Reconcile(req ctrl.Request) (ctrl.Result, erro
|
|||||||
reschedule := ctrl.Result{RequeueAfter: 5 * time.Second}
|
reschedule := ctrl.Result{RequeueAfter: 5 * time.Second}
|
||||||
|
|
||||||
r.BackupSession.Status.StartTime = &metav1.Time{Time: time.Now()}
|
r.BackupSession.Status.StartTime = &metav1.Time{Time: time.Now()}
|
||||||
|
r.BackupConf = &formolv1alpha1.BackupConfiguration{}
|
||||||
|
if err := r.Get(ctx, client.ObjectKey{
|
||||||
|
Namespace: r.BackupSession.Namespace,
|
||||||
|
Name: r.BackupSession.Spec.Ref.Name}, r.BackupConf); err != nil {
|
||||||
|
log.Error(err, "unable to get backupConfiguration")
|
||||||
|
return ctrl.Result{}, client.IgnoreNotFound(err)
|
||||||
|
}
|
||||||
|
|
||||||
if r.IsBackupOngoing() {
|
if r.IsBackupOngoing() {
|
||||||
// There is already a backup ongoing. We don't do anything and we reschedule
|
// There is already a backup ongoing. We don't do anything and we reschedule
|
||||||
log.V(0).Info("there is an ongoing backup. let's reschedule this operation")
|
log.V(0).Info("there is an ongoing backup. let's reschedule this operation")
|
||||||
|
|||||||
@ -214,6 +214,16 @@ func (r *RestoreSessionReconciler) Reconcile(req ctrl.Request) (ctrl.Result, err
|
|||||||
log.Error(err, "unable to get restoresession")
|
log.Error(err, "unable to get restoresession")
|
||||||
return ctrl.Result{}, client.IgnoreNotFound(err)
|
return ctrl.Result{}, client.IgnoreNotFound(err)
|
||||||
}
|
}
|
||||||
|
if r.RestoreSession.Status.ObservedGeneration == r.RestoreSession.ObjectMeta.Generation {
|
||||||
|
// status update
|
||||||
|
log.V(0).Info("status update")
|
||||||
|
return ctrl.Result{}, r.StatusUpdate()
|
||||||
|
}
|
||||||
|
r.RestoreSession.Status.ObservedGeneration = r.RestoreSession.ObjectMeta.Generation
|
||||||
|
r.RestoreSession.Status.SessionState = formolv1alpha1.New
|
||||||
|
r.RestoreSession.Status.StartTime = &metav1.Time{Time: time.Now()}
|
||||||
|
reschedule := ctrl.Result{RequeueAfter: 5 * time.Second}
|
||||||
|
|
||||||
r.BackupSession = &formolv1alpha1.BackupSession{}
|
r.BackupSession = &formolv1alpha1.BackupSession{}
|
||||||
if err := r.Get(ctx, client.ObjectKey{
|
if err := r.Get(ctx, client.ObjectKey{
|
||||||
Namespace: r.RestoreSession.Spec.BackupSessionRef.Namespace,
|
Namespace: r.RestoreSession.Spec.BackupSessionRef.Namespace,
|
||||||
@ -229,16 +239,6 @@ func (r *RestoreSessionReconciler) Reconcile(req ctrl.Request) (ctrl.Result, err
|
|||||||
return ctrl.Result{}, client.IgnoreNotFound(err)
|
return ctrl.Result{}, client.IgnoreNotFound(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.RestoreSession.Status.ObservedGeneration == r.RestoreSession.ObjectMeta.Generation {
|
|
||||||
// status update
|
|
||||||
log.V(0).Info("status update")
|
|
||||||
return ctrl.Result{}, r.StatusUpdate()
|
|
||||||
}
|
|
||||||
r.RestoreSession.Status.ObservedGeneration = r.RestoreSession.ObjectMeta.Generation
|
|
||||||
r.RestoreSession.Status.SessionState = formolv1alpha1.New
|
|
||||||
r.RestoreSession.Status.StartTime = &metav1.Time{Time: time.Now()}
|
|
||||||
reschedule := ctrl.Result{RequeueAfter: 5 * time.Second}
|
|
||||||
|
|
||||||
if err := r.Status().Update(ctx, r.RestoreSession); err != nil {
|
if err := r.Status().Update(ctx, r.RestoreSession); err != nil {
|
||||||
log.Error(err, "unable to update restoresession")
|
log.Error(err, "unable to update restoresession")
|
||||||
return ctrl.Result{}, err
|
return ctrl.Result{}, err
|
||||||
|
|||||||
@ -7,7 +7,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
repository:
|
repository:
|
||||||
name: repo-minio
|
name: repo-minio
|
||||||
schedule: "40 * * * *"
|
schedule: "15 * * * *"
|
||||||
targets:
|
targets:
|
||||||
- kind: Deployment
|
- kind: Deployment
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user