-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: stagedUpdateRun e2e tests #1035
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,7 +200,8 @@ func (r *Reconciler) executeDeleteStage( | |
for i := range existingDeleteStageStatus.Clusters { | ||
existingDeleteStageClusterMap[existingDeleteStageStatus.Clusters[i].ClusterName] = &existingDeleteStageStatus.Clusters[i] | ||
} | ||
deletingBinding := 0 | ||
// Mark the delete stage as started in case it's not. | ||
markStageUpdatingStarted(updateRun.Status.DeletionStageStatus, updateRun.Generation) | ||
Comment on lines
+203
to
+204
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this idempotent? will it change the LTT or something else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, it's idempotent. What's LTT? The startTime is only set when it's nil. The condition does not change. |
||
for _, binding := range toBeDeletedBindings { | ||
curCluster, exist := existingDeleteStageClusterMap[binding.Spec.TargetCluster] | ||
if !exist { | ||
|
@@ -225,7 +226,6 @@ func (r *Reconciler) executeDeleteStage( | |
klog.ErrorS(unexpectedErr, "The binding should be deleting before we mark a cluster deleting", "clusterStatus", curCluster, "clusterStagedUpdateRun", updateRunRef) | ||
return false, fmt.Errorf("%w: %s", errStagedUpdatedAborted, unexpectedErr.Error()) | ||
} | ||
deletingBinding++ | ||
continue | ||
} | ||
// The cluster status is not deleting yet | ||
|
@@ -235,10 +235,6 @@ func (r *Reconciler) executeDeleteStage( | |
} | ||
klog.V(2).InfoS("Deleted a binding pointing to a to be deleted cluster", "binding", klog.KObj(binding), "cluster", curCluster.ClusterName, "clusterStagedUpdateRun", updateRunRef) | ||
markClusterUpdatingStarted(curCluster, updateRun.Generation) | ||
if deletingBinding == 0 { | ||
markStageUpdatingStarted(updateRun.Status.DeletionStageStatus, updateRun.Generation) | ||
} | ||
deletingBinding++ | ||
} | ||
// The rest of the clusters in the stage are not in the toBeDeletedBindings so it should be marked as delete succeeded. | ||
for _, clusterStatus := range existingDeleteStageClusterMap { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not 100% sure the new name is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the fix to use index, instead of name, it only shows a number: e.g. "0", "1". I feel it's better to indicate it's an index.