Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie17Li committed Sep 25, 2023
1 parent 5dae446 commit 4106469
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,16 +388,30 @@ func (r *ModuleDeploymentReconciler) updateModuleReplicaSet(moduleDeployment *mo
}

moduleDeployment.Status.ReleaseStatus.CurrentBatch += 1
moduleDeployment.Status.ReleaseStatus.Progress = moduledeploymentv1alpha1.ModuleDeploymentReleaseProgressExecuting
moduleDeployment.Status.ReleaseStatus.LastTransitionTime = metav1.Now()

var grayTime = 0

if moduleDeployment.Spec.OperationStrategy.NeedConfirm {
moduleDeployment.Status.ReleaseStatus.Progress = moduledeploymentv1alpha1.ModuleDeploymentReleaseProgressWaitingForConfirmation
} else if grayTime = int(moduleDeployment.Spec.OperationStrategy.GrayTimeBetweenBatchSeconds); grayTime != 0 {
if curBatch == batchCount {
moduleDeployment.Status.ReleaseStatus.Progress = moduledeploymentv1alpha1.ModuleDeploymentReleaseProgressExecuting
} else {
moduleDeployment.Status.ReleaseStatus.Progress = moduledeploymentv1alpha1.ModuleDeploymentReleaseProgressPaused
}
} else {
moduleDeployment.Status.ReleaseStatus.Progress = moduledeploymentv1alpha1.ModuleDeploymentReleaseProgressExecuting
}

moduleDeployment.Status.Conditions = append(moduleDeployment.Status.Conditions, moduledeploymentv1alpha1.ModuleDeploymentCondition{
Type: moduledeploymentv1alpha1.DeploymentProgressing,
Status: corev1.ConditionTrue,
LastTransitionTime: metav1.Now(),
Message: fmt.Sprintf("deployment release: curbatch %v, batchCount %v", curBatch, batchCount),
})

return false, r.Status().Update(ctx, moduleDeployment)
return grayTime == 0, r.Status().Update(ctx, moduleDeployment)
}

// generate module replicas
Expand Down

0 comments on commit 4106469

Please sign in to comment.