Skip to content

Commit 3331559

Browse files
Merge pull request #354 from beagles/jira-18458
Don't update pool update hash until job is successful
2 parents f3f95ea + 66b437e commit 3331559

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

controllers/designate_controller.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -887,15 +887,8 @@ func (r *DesignateReconciler) reconcileNormal(ctx context.Context, instance *des
887887
if oldHash != poolsYamlHash {
888888
Log.Info(fmt.Sprintf("Old poolsYamlHash %s is different than new poolsYamlHash %s.\nLaunching pool update job", oldHash, poolsYamlHash))
889889

890-
instance.Status.Hash[designatev1beta1.PoolUpdateHash] = poolsYamlHash
891-
if err := r.Client.Status().Update(ctx, instance); err != nil {
892-
return ctrl.Result{}, fmt.Errorf("failed to update status hash: %w", err)
893-
}
894-
895890
jobDef := designate.PoolUpdateJob(instance, serviceLabels, serviceAnnotations)
896-
897891
Log.Info("Initializing pool update job")
898-
899892
poolUpdatejob := job.NewJob(
900893
jobDef,
901894
designatev1beta1.PoolUpdateHash,
@@ -909,6 +902,7 @@ func (r *DesignateReconciler) reconcileNormal(ctx context.Context, instance *des
909902
return ctrl.Result{}, err
910903
}
911904
Log.Info("Pool update job completed successfully")
905+
instance.Status.Hash[designatev1beta1.PoolUpdateHash] = poolsYamlHash
912906
}
913907
}
914908

0 commit comments

Comments
 (0)