New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow StackCollection.DeleteStackByName() to succeed #2308
Conversation
pkg/cfn/manager/api.go
Outdated
@@ -337,8 +337,7 @@ func defaultStackStatusFilter() []*string { | |||
|
|||
// DeleteStackByName sends a request to delete the stack | |||
func (c *StackCollection) DeleteStackByName(name string) (*Stack, error) { | |||
i := &Stack{StackName: &name} | |||
s, err := c.DescribeStack(i) | |||
i, err := c.DescribeStack(&Stack{StackName: &name}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we rename i
to stack
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, it should be s
to be consistent with other usages throughout eksctl.
(eksctl seems to use i
to describe something like "input stack to perform action on". for actions that return a stack it is usually assigned to s
which would denote a complete stack object having all the fields filled out.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch 👍 I only have one nitpick comment but it's approved
57d49b9
to
1c4bdce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! ✨
`StackCollection.DeleteStackBySpec(*Stack)` only deletes the stack if its tags match the clustername. For that reason we not only need to pass in the `StackName` and `StackId` but also `Tags`.
1c4bdce
to
e87f34c
Compare
Fixes #2307
StackCollection.DeleteStackBySpec(*Stack)
only deletes the stack ifits tags match the clustername. For that reason we not only need to pass
in the
StackName
andStackId
but alsoTags
.