Skip to content

Commit

Permalink
Merge pull request #985 from wzshiming/fix/stage-delete-and-immediate
Browse files Browse the repository at this point in the history
Fix updates for both delete and immediateNextStage
  • Loading branch information
wzshiming authored Mar 6, 2024
2 parents b441343 + 7f04544 commit 1ad9796
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/kwok/controllers/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ func (c *NodeController) playStage(ctx context.Context, node *corev1.Node, stage
if err != nil {
return shouldRetry(err), fmt.Errorf("failed to delete node %s: %w", node.Name, err)
}
result = nil
} else if next.StatusTemplate != "" {
patch, err = c.computeStatusPatch(node, next.StatusTemplate)
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions pkg/kwok/controllers/pod_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,9 @@ func (c *PodController) playStage(ctx context.Context, pod *corev1.Pod, stage *L
if next.Delete {
err = c.deleteResource(ctx, pod)
if err != nil {
if err != nil {
return shouldRetry(err), fmt.Errorf("failed to delete pod %s: %w", pod.Name, err)
}
return shouldRetry(err), fmt.Errorf("failed to delete pod %s: %w", pod.Name, err)
}
result = nil
} else if next.StatusTemplate != "" {
patch, err = c.computeStatusPatch(pod, next.StatusTemplate)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/kwok/controllers/stage_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ func (c *StageController) playStage(ctx context.Context, resource *unstructured.
if err != nil {
return shouldRetry(err), fmt.Errorf("failed to delete resource %s: %w", resource.GetName(), err)
}
result = nil
} else if next.StatusTemplate != "" {
patch, err = c.computeStatusPatch(resource, next.StatusTemplate)
if err != nil {
Expand Down

0 comments on commit 1ad9796

Please sign in to comment.