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

Change StackExists behaviour #1499

Conversation

davidmccormick
Copy link
Contributor

@c-knowles when we changed to using DescribeStacks instead of ListStacks it now returns an error if the stack does not exist. This change detects if the error was caused by the stack not existing and returns false and nil error instead.

This helps prevent errors like when running validate or apply...

kube-aws validate -v
Called RenderStackTemplateAsString on network
testing whether cf stack perf1-XXXbackend-lab-secure exists
calling AWS cloudformation DescribeStacks ->
<- AWS Responded with an error: ValidationError: Stack with id perf1-XXXbackend-lab-secure does not exist
	status code: 400, request id: 2c838630-ed7a-11e8-8f78-a39daf096ab7
Error does not match 'ValidationError: Stack with id perf1-XXXbackend-lab-secure does not exist'
failed to initialize cluster driver: unable to lookup cloud formation stack perf1-XXXbackend-lab-secure: could not list cloudformation stacks: ValidationError: Stack with id perf1-XXXbackend-lab-secure does not exist
	status code: 400, request id: 2c838630-ed7a-11e8-8f78-a39daf096ab7

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 21, 2018
@davidmccormick davidmccormick changed the title Change StackExists behavoiur Change StackExists behaviour Nov 21, 2018
@codecov-io
Copy link

Codecov Report

Merging #1499 into master will increase coverage by 0.01%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1499      +/-   ##
=========================================
+ Coverage   25.38%   25.4%   +0.01%     
=========================================
  Files          97      97              
  Lines        4987    4991       +4     
=========================================
+ Hits         1266    1268       +2     
- Misses       3575    3577       +2     
  Partials      146     146
Impacted Files Coverage Δ
cfnstack/cfnstack.go 83.6% <84.61%> (-2.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8158496...e402963. Read the comment docs.

@cknowles
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2018
@cknowles
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: c-knowles

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 27, 2018
@cknowles
Copy link
Contributor

/check-cla

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 27, 2018
@k8s-ci-robot k8s-ci-robot merged commit d219030 into kubernetes-retired:master Nov 27, 2018
cknowles pushed a commit to cknowles/kube-aws that referenced this pull request Dec 5, 2018
…stack-exists-behavoir

Change StackExists behaviour
@davidmccormick davidmccormick deleted the correct-stack-exists-behavoir branch January 2, 2019 11:32
@davidmccormick davidmccormick added this to the v0.13.0 milestone Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants