-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(traffic-guards): bypass check for pinned server groups (#3507)
* feat(traffic-guards): bypass check for pinned server groups A common use case that trips up traffic guards is things like: 1. staging clusters with a fixed size (e.g. 3/3/3) 2. a deploy fails for some reason, leaving multiple server groups 3. from this point on, all deploys will fail the traffic guard capacity check (as you would delete N*3 instances and only leave 3 up) It seems reasonable to punch an exception through traffic guards when this happens: - there are multiple server groups going away, all with the same fixed size - the action leaves _some_ instances up
- Loading branch information
Showing
5 changed files
with
129 additions
and
3 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
.../groovy/com/netflix/spinnaker/orca/clouddriver/pipeline/servergroup/support/Capacity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.netflix.spinnaker.orca.clouddriver.pipeline.servergroup.support; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import java.util.Map; | ||
import javax.annotation.Nonnegative; | ||
import lombok.Value; | ||
|
||
@Value | ||
public class Capacity { | ||
@Nonnegative int min; | ||
|
||
@Nonnegative int max; | ||
|
||
@Nonnegative int desired; | ||
|
||
/** | ||
* @return true if the capacity of this server group is fixed, i.e min, max and desired are all | ||
* the same | ||
*/ | ||
public boolean isPinned() { | ||
return (max == desired) && (desired == min); | ||
} | ||
|
||
public Map<String, Integer> asMap() { | ||
return ImmutableMap.of("min", min, "max", max, "desired", desired); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...er/src/main/groovy/com/netflix/spinnaker/orca/kato/pipeline/support/ResizeStrategy.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters