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

change -all flag to remove whole group #13

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

laDok8
Copy link
Contributor

@laDok8 laDok8 commented May 4, 2022

delete whole resource group with --all if all resources are older than SLA. deleting individual resources would be difficult due to inability to delete dependent resources.

depends on: RedHatQE/wrapanapi#453

@laDok8 laDok8 marked this pull request as draft May 4, 2022 10:42
@jyejare
Copy link
Collaborator

jyejare commented May 27, 2022

@laDok8 Please let me know when you have this open for review !

@laDok8 laDok8 changed the title DRAFT: change -all flag to remove whole group change -all flag to remove whole group May 29, 2022
@laDok8 laDok8 marked this pull request as ready for review May 29, 2022 06:43
@laDok8
Copy link
Contributor Author

laDok8 commented May 29, 2022

@jyejare as wrapanapi PR seems ok i think we are ready

Copy link
Collaborator

@jyejare jyejare left a comment

Choose a reason for hiding this comment

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

Modify the PR to add another option to Azure base command --all_since to preserve the usage of --all.

README.md Outdated
@@ -99,7 +99,7 @@ Usage: swach azure [OPTIONS]
Cleanup Azure provider

Options:
--all Remove all unused Resources from the provider
--all Remove all Resources from the provider over SLA
Copy link
Collaborator

Choose a reason for hiding this comment

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

The --all is made for removing the VMs under SLA but the same is not applied for other resources lets say for NICs, discs etc. These resources are deleted with --all when they are not attached to any VM. Also, this functioning of --all for other Compute Providers like GCE, EC2 is similar.

This PR here will alter that behaviour just for Azure and that might confuse the users of cloudwash who are using this tool for multiple cloud providers cleanup.

Hence, I recommend adding an extra option --all_since to Azure command base that can take by default take SLA minutes from settings file else accept it as argument to --all_since option.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
cloudwash/providers/azure.py Outdated Show resolved Hide resolved
cloudwash/providers/azure.py Outdated Show resolved Hide resolved
cloudwash/providers/azure.py Show resolved Hide resolved
@laDok8 laDok8 force-pushed the add.purge_all branch 2 times, most recently from 37510b3 to f4ae352 Compare June 6, 2022 09:37
@jyejare jyejare marked this pull request as draft June 7, 2022 10:47
@jyejare
Copy link
Collaborator

jyejare commented Jun 7, 2022

@laDok8 Moved this to Draft state since you are amending the comments! Move it Ready for Review when you are ready for review !

@jyejare
Copy link
Collaborator

jyejare commented Jun 15, 2022

Ping @laDok8 !! Is it ready for review now ?

@laDok8 laDok8 force-pushed the add.purge_all branch 2 times, most recently from 076d02d to a7ee6a2 Compare June 16, 2022 11:39
@laDok8 laDok8 marked this pull request as ready for review June 16, 2022 11:39
@laDok8
Copy link
Contributor Author

laDok8 commented Jun 16, 2022

@jyejare ready for review. I was just trying to come up with better help option explanation, previous may have been a little confusing as this option doesn't selectively delete resources but whole group only if all its resources are older otherwise nothing is deleted.

Copy link
Collaborator

@jyejare jyejare left a comment

Choose a reason for hiding this comment

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

Only few comments to go now :)

README.md Outdated
--pips Remove only PiPs from the provider
--help Show this message and exit.
--all Remove all unused Resources from the provider
--all_if_older Remove provider group if all resources are older than SLA
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am still filling for all_if_older :)

Cant, we rename something like rg? the description of that option is enough to tell what its going to delete.

cloudwash/cli.py Outdated Show resolved Hide resolved
delete azure resource group if newest resource is older than SLA
@jyejare
Copy link
Collaborator

jyejare commented Jun 17, 2022

@laDok8 Would you like to see a new cloudwash version on merge of this PR ? Are you using versioned / PyPi_published package in your project ?

@jyejare jyejare merged commit 2f606db into RedHatQE:master Jun 17, 2022
@laDok8
Copy link
Contributor Author

laDok8 commented Jun 17, 2022

@jyejare new version would be appreciated, I'm using pip version as desribed in README installation proces.
Could you please take a look at wrapanapi changes as this fucntionality won't work without them applied.

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