Fix error when canceling update (#2254)

* Fix error when canceling update

* Update error message
This commit is contained in:
Chris Smith 2018-11-29 12:54:05 -08:00 committed by GitHub
parent 95db6439f5
commit 55bea65276
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -822,6 +822,10 @@ func (b *cloudBackend) CancelCurrentUpdate(ctx context.Context, stackRef backend
return err
}
if stack.ActiveUpdate == "" {
return errors.Errorf("stack %v has never been updated", stackRef)
}
// Compute the update identifier and attempt to cancel the update.
//
// NOTE: the update kind is not relevant; the same endpoint will work for updates of all kinds.

View file

@ -34,11 +34,11 @@ type UpdateResult string
const (
// InProgressResult is for updates that have not yet completed.
InProgressResult = "in-progress"
InProgressResult UpdateResult = "in-progress"
// SucceededResult is for updates that completed successfully.
SucceededResult UpdateResult = "succeeded"
// FailedResult is for updates that have failed.
FailedResult = "failed"
FailedResult UpdateResult = "failed"
)
// Keys we use for values put into UpdateInfo.Environment.