Skip to content
Permalink
Browse files

fix stack deletions due to custom stages changes

  • Loading branch information...
tj committed Feb 7, 2018
1 parent f64a343 commit 8abb85e552214825a44c6dbf659136bad6f31c35
Showing with 8 additions and 3 deletions.
  1. +6 −1 platform/lambda/lambda.go
  2. +2 −2 platform/lambda/stack/stack.go
@@ -250,12 +250,17 @@ func (p *Platform) DeleteStack(region string, wait bool) error {
return errors.Wrap(err, "creating iam role")
}

versions, err := p.getAliasVersions(region)
if err != nil {
return errors.Wrap(err, "fetching alias versions")
}

if err := p.deleteBucketObjects(region); err != nil && !util.IsNotFound(err) {
return errors.Wrap(err, "deleting s3 objects")
}

log.Debug("deleting stack")
if err := stack.New(p.config, p.events, nil, region).Delete(wait); err != nil {
if err := stack.New(p.config, p.events, nil, region).Delete(versions, wait); err != nil {
return errors.Wrap(err, "deleting stack")
}

@@ -118,7 +118,7 @@ func (s *Stack) Create(versions resources.Versions) error {
}

// Delete the stack, optionally waiting for completion.
func (s *Stack) Delete(wait bool) error {
func (s *Stack) Delete(versions resources.Versions, wait bool) error {
_, err := s.client.DeleteStack(&cloudformation.DeleteStackInput{
StackName: &s.config.Name,
})
@@ -128,7 +128,7 @@ func (s *Stack) Delete(wait bool) error {
}

if wait {
tmpl := s.template(resources.Versions{})
tmpl := s.template(versions)
if err := s.report(resourceStateFromTemplate(tmpl, DeleteComplete)); err != nil {
return errors.Wrap(err, "reporting")
}

0 comments on commit 8abb85e

Please sign in to comment.
You can’t perform that action at this time.