Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
Signed-off-by: yunbo <[email protected]>
  • Loading branch information
Funinu committed Aug 20, 2024
1 parent 5fe4b6f commit 10f531d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions api/v1alpha1/rollout_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ type RolloutStatus struct {
// Conditions a list of conditions a rollout can have.
// +optional
Conditions []RolloutCondition `json:"conditions,omitempty"`
// +optional
//BlueGreenStatus *BlueGreenStatus `json:"blueGreenStatus,omitempty"`
// Phase is the rollout phase.
Phase RolloutPhase `json:"phase,omitempty"`
// Message provides details on why the rollout is in its current phase
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/rollout_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ type CanaryStatus struct {
// BlueGreenStatus status fields that only pertain to the blueGreen rollout
type BlueGreenStatus struct {
CommonStatus `json:",inline"`
// CanaryRevision is calculated by rollout based on podTemplateHash, and the internal logic flow uses
// UpdatedRevision is calculated by rollout based on podTemplateHash, and the internal logic flow uses
// It may be different from rs podTemplateHash in different k8s versions, so it cannot be used as service selector label
UpdatedRevision string `json:"updatedRevision"`
// UpdatedReplicas the numbers of updated pods
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/rollout/rollout_canary.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ func (m *canaryReleaseManager) syncBatchRelease(br *v1beta1.BatchRelease, canary
func nextTask(reason string, currentTask v1beta1.FinalisingStepType) v1beta1.FinalisingStepType {
var taskSequence []v1beta1.FinalisingStepType
//REVIEW - should we consider more complex scenarios?
// like, user pauses Rollout and rollbacks the workload at the same time?
// like, user disables Rollout and rollbacks the workload at the same time?
switch reason {
case v1beta1.FinaliseReasonRollback: // rollback
taskSequence = []v1beta1.FinalisingStepType{
Expand All @@ -658,7 +658,7 @@ func nextTask(reason string, currentTask v1beta1.FinalisingStepType) v1beta1.Fin
v1beta1.FinalisingStepTypeDeleteBR,
v1beta1.FinalisingStepTypeTrafficRouting, // do cleaning works(restore stable Service, remove canary Service)

Check warning on line 659 in pkg/controller/rollout/rollout_canary.go

View check run for this annotation

Codecov / codecov/patch

pkg/controller/rollout/rollout_canary.go#L654-L659

Added lines #L654 - L659 were not covered by tests
}
default: // others: success/paused/disabled
default: // others: success/disabled/deleting rollout
taskSequence = []v1beta1.FinalisingStepType{
v1beta1.FinalisingStepTypeTrafficRouting, // remove selector of stable Service
v1beta1.FinalisingStepTypeBatchRelease, // scale up new, scale down old
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/rollout/rollout_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func (r *RolloutReconciler) reconcileRolloutTerminating(rollout *v1beta1.Rollout
klog.Errorf("rollout(%s/%s) get workload failed: %s", rollout.Namespace, rollout.Name, err.Error())
return nil, err
}
c := &RolloutContext{Rollout: rollout, NewStatus: newStatus, Workload: workload}
c := &RolloutContext{Rollout: rollout, NewStatus: newStatus, Workload: workload, FinalizeReason: v1beta1.FinaliseReasonDelete}

Check warning on line 241 in pkg/controller/rollout/rollout_status.go

View check run for this annotation

Codecov / codecov/patch

pkg/controller/rollout/rollout_status.go#L241

Added line #L241 was not covered by tests
done, err := r.doFinalising(c)
if err != nil {
return nil, err
Expand All @@ -262,7 +262,7 @@ func (r *RolloutReconciler) reconcileRolloutDisabling(rollout *v1beta1.Rollout,
klog.Errorf("rollout(%s/%s) get workload failed: %s", rollout.Namespace, rollout.Name, err.Error())
return nil, err
}
c := &RolloutContext{Rollout: rollout, NewStatus: newStatus, Workload: workload}
c := &RolloutContext{Rollout: rollout, NewStatus: newStatus, Workload: workload, FinalizeReason: v1beta1.FinaliseReasonDisalbed}

Check warning on line 265 in pkg/controller/rollout/rollout_status.go

View check run for this annotation

Codecov / codecov/patch

pkg/controller/rollout/rollout_status.go#L265

Added line #L265 was not covered by tests
done, err := r.doFinalising(c)
if err != nil {
return nil, err
Expand Down

0 comments on commit 10f531d

Please sign in to comment.