Skip to content

Commit

Permalink
disabled rollout
Browse files Browse the repository at this point in the history
Signed-off-by: Kuromesi <blackfacepan@163.com>
  • Loading branch information
Kuromesi committed Jul 5, 2023
1 parent a759390 commit 30acbf5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 0 additions & 5 deletions pkg/controller/rollout/rollout_canary.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,6 @@ func (m *canaryReleaseManager) finalizingBatchRelease(c *RolloutContext) (bool,
return false, err
}
klog.Infof("rollout(%s/%s) patch batchRelease(%s) success", c.Rollout.Namespace, c.Rollout.Name, body)

// if rollout is disabling, then the batchrelease should be deleted
if c.NewStatus.Phase == v1alpha1.RolloutPhaseDisabling {
return true, nil
}
return false, nil
}

Expand Down
4 changes: 1 addition & 3 deletions pkg/controller/rollout/rollout_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func (r *RolloutReconciler) calculateRolloutStatus(rollout *v1alpha1.Rollout) (r
newStatus.Message = "Disabling rollout, release resources"
} else {
newStatus.Phase = v1alpha1.RolloutPhaseDisabled
newStatus.ObservedGeneration = rollout.Generation
newStatus.Message = "Rollout is disabled"
}
}
Expand All @@ -77,8 +76,8 @@ func (r *RolloutReconciler) calculateRolloutStatus(rollout *v1alpha1.Rollout) (r
Phase: v1alpha1.RolloutPhaseInitial,
Message: "Workload Not Found",
}
klog.Infof("rollout(%s/%s) workload not found, and reset status be Initial", rollout.Namespace, rollout.Name)
}
klog.Infof("rollout(%s/%s) workload not found, and reset status be Initial", rollout.Namespace, rollout.Name)
return false, newStatus, nil
}
klog.V(5).Infof("rollout(%s/%s) workload(%s)", rollout.Namespace, rollout.Name, util.DumpJSON(workload))
Expand Down Expand Up @@ -240,7 +239,6 @@ func (r *RolloutReconciler) reconcileRolloutDisabling(rollout *v1alpha1.Rollout,
} else if done {
klog.Infof("rollout(%s/%s) is disabled", rollout.Namespace, rollout.Name)
newStatus.Phase = v1alpha1.RolloutPhaseDisabled
newStatus.ObservedGeneration = rollout.Generation
newStatus.Message = "Rollout is disabled"
} else {
// Incomplete, recheck
Expand Down
6 changes: 5 additions & 1 deletion pkg/webhook/workload/mutating/workload_update_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,11 @@ func (h *WorkloadHandler) fetchMatchedRollout(obj client.Object) (*appsv1alpha1.
}
for i := range rolloutList.Items {
rollout := &rolloutList.Items[i]
if !rollout.DeletionTimestamp.IsZero() || rollout.Spec.ObjectRef.WorkloadRef == nil || rollout.Status.Phase == appsv1alpha1.RolloutPhaseDisabled {
if !rollout.DeletionTimestamp.IsZero() || rollout.Spec.ObjectRef.WorkloadRef == nil {
continue
}
if rollout.Status.Phase == appsv1alpha1.RolloutPhaseDisabled {
klog.Infof("Disabled rollout(%s/%s) fetched when fetching matched rollout", rollout.Namespace, rollout.Name)
continue
}
ref := rollout.Spec.ObjectRef.WorkloadRef
Expand Down

0 comments on commit 30acbf5

Please sign in to comment.