Skip to content
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

[WIP]Elasticache Teardown #1

Merged
merged 15 commits into from
Mar 10, 2020

Conversation

hubeadmin
Copy link
Contributor

@hubeadmin hubeadmin commented Feb 26, 2020

Adding new classes to the AWS teardown CLI for elasticache and postgres

@hubeadmin hubeadmin changed the title Initial Commit for elasticache teardown class [WIP]Elasticache & postgres teardown Feb 26, 2020
@hubeadmin hubeadmin force-pushed the INTLY-5006-aws-teardown branch from 6231afd to 0032c46 Compare March 2, 2020 15:51
Copy link
Contributor

@aidenkeating aidenkeating left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small comments.

We should also remove ./a.out, looks like it was added by accident. A git status and git add'ing files or directories to the staging area/index in git individually may have helped avoid this. See [1] for more details.

Let's also ensure we have tests for the elasticache#DeleteResourcesForCluster function before merging. [2] can be used as a template here.

[1] https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository
[2] https://github.com/integr8ly/cluster-service/blob/95cd3421a83db0e95dfdfd00db9afe5c2d42fbb3/pkg/aws/rds_test.go

@hubeadmin hubeadmin changed the title [WIP]Elasticache & postgres teardown [WIP]Elasticache Teardown Mar 3, 2020
Copy link
Contributor

@aidenkeating aidenkeating left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, will try it out on a cluster

},
taggingClient: func() *resourcetaggingClientMock {
fakeTaggingClient, err := fakeResourcetaggingClient(func(c *resourcetaggingClientMock) error {
c.GetResourcesFunc = func(in1 *resourcegroupstaggingapi.GetResourcesInput) (output *resourcegroupstaggingapi.GetResourcesOutput, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we returning an error when mocking this function if we're expecting the entire function run to pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My Approach to this was that we want to block the input for the delete function by returning a nil as an output of getResources so that it doesn't have anything to delete, and then since it doesn't delete anything it won't return the reportItem, then just checking that the report item isn't in fact created when no resources are deleted

Copy link
Contributor

@aidenkeating aidenkeating left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested locally against aws. looks good

@aidenkeating aidenkeating merged commit 7adf293 into integr8ly:master Mar 10, 2020
aidenkeating pushed a commit that referenced this pull request Mar 18, 2020
refactor snapshot deletion to not require replicationgroup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants