Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #135 from phylake/hotswap
Browse files Browse the repository at this point in the history
Hotswap and ASG matching stack state fixes
  • Loading branch information
phylake authored Nov 3, 2016
2 parents 4eaf6f0 + 7cec78d commit 35deb78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### v3.0.2

- additional UPDATE steady states allow ASG matching
- any UPDATE in progress state causes hot swap to fail
- mac binaries are now built with Go 1.7.3
- match currently promoted stack's ASG size for provisioning and hot swap

Expand Down
26 changes: 2 additions & 24 deletions commands/build/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,34 +157,12 @@ func ProvisionOrHotswapStack(env string) (success bool) {
case cfn.CREATE_COMPLETE, cfn.UPDATE_COMPLETE:
// only states eligible for hot swap

case cfn.CREATE_FAILED,
cfn.DELETE_COMPLETE,
cfn.DELETE_FAILED,
cfn.DELETE_IN_PROGRESS,
cfn.ROLLBACK_COMPLETE,
cfn.ROLLBACK_FAILED,
cfn.ROLLBACK_IN_PROGRESS:

hotswapData.shouldHotswap = false

case cfn.CREATE_IN_PROGRESS:

log.Error("Can't hot swap a stack being created")
return

case cfn.UPDATE_COMPLETE_CLEANUP_IN_PROGRESS,
cfn.UPDATE_IN_PROGRESS:

log.Error("A previous hot swap is still in progress",
"StackStatus", hotswapData.stackStatus)
return

case cfn.UPDATE_ROLLBACK_COMPLETE,
cfn.UPDATE_IN_PROGRESS,
cfn.UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS,
cfn.UPDATE_ROLLBACK_FAILED,
cfn.UPDATE_ROLLBACK_IN_PROGRESS:

log.Error("A previous hot swap appears to have failed",
log.Error("A previous hot swap is still in progress",
"StackStatus", hotswapData.stackStatus)
return

Expand Down
3 changes: 2 additions & 1 deletion provision/stack_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ tagLoop:
switch stackStatus {
case cfn.CREATE_COMPLETE,
cfn.UPDATE_COMPLETE,
cfn.UPDATE_ROLLBACK_COMPLETE:
cfn.UPDATE_ROLLBACK_COMPLETE,
cfn.UPDATE_ROLLBACK_FAILED:

// error cases that should cause a failure
case cfn.CREATE_IN_PROGRESS,
Expand Down

0 comments on commit 35deb78

Please sign in to comment.