Skip to content

Commit 66b437e

Browse files
committed
Don't update pool update hash until job is successful
Fixes a bug where we update a hash before the job that it is supposed to trigger the poolupdatejob before it succeeds making the controller skip further attempts. This leads to a broken internal configuration in designate that won't be rectified until something changes the contents of a the pools.yaml file like scaling changes for mDNS or the BIND9 instances or the values in nsRecords.
1 parent b902e3a commit 66b437e

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)