Skip to content

Commit

Permalink
Fix downtime on initial deployment using Istio DestinationRule Subsets
Browse files Browse the repository at this point in the history
  • Loading branch information
wmuizelaar committed May 28, 2024
1 parent 2e7cf69 commit bde071e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rollout/trafficrouting.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ func (c *rolloutContext) reconcileTrafficRouting() error {
if err != nil {
return err
}

} else if c.newRS == nil || c.newRS.Status.AvailableReplicas == 0 {
// when newRS is not available or replicas num is 0. never weight to canary
weightDestinations = append(weightDestinations, c.calculateWeightDestinationsFromExperiment()...)
Expand Down Expand Up @@ -250,6 +249,16 @@ func (c *rolloutContext) reconcileTrafficRouting() error {
}
}

// We need to check if the replicasets are ready here as well if we didn't define any services in the rollout
// See: https://github.com/argoproj/argo-rollouts/issues/2507
if c.rollout.Spec.Strategy.Canary.CanaryService == "" && c.rollout.Spec.Strategy.Canary.StableService == "" {
for _, rs := range c.allRSs {
if *rs.Spec.Replicas > 0 && !replicasetutil.IsReplicaSetAvailable(rs) {
return fmt.Errorf("delaying destination rule switch: ReplicaSet %s not fully available", rs)
}
}
}

err = reconciler.UpdateHash(canaryHash, stableHash, weightDestinations...)
if err != nil {
return err
Expand Down

0 comments on commit bde071e

Please sign in to comment.