Skip to content

Commit

Permalink
fix: add nil pointer handle logic
Browse files Browse the repository at this point in the history
Signed-off-by: zezaeoh <[email protected]>
  • Loading branch information
zezaeoh committed May 18, 2021
1 parent 5f7e994 commit 3e1f571
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rollout/trafficrouting.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ func (c *rolloutContext) reconcileTrafficRouting() error {
// when we are fully promoted. desired canary weight should be 0
} else if c.pauseContext.IsAborted() {
// when promote aborted. desired canary weight should be 0
} else if c.newRS.Status.AvailableReplicas == 0 {
// when newRS available replicas num is 0. never weight to canary
} else if c.newRS == nil || c.newRS.Status.AvailableReplicas == 0 {
// when newRS is not available or replicas num is 0. never weight to canary
} else if index != nil {
atDesiredReplicaCount := replicasetutil.AtDesiredReplicaCountsForCanary(c.rollout, c.newRS, c.stableRS, c.otherRSs)
if !atDesiredReplicaCount {
Expand Down

0 comments on commit 3e1f571

Please sign in to comment.