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

Develop: Rebase for OCP resource cleanup on AWS #137

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jyejare
Copy link
Collaborator

@jyejare jyejare commented Aug 1, 2024

Rebasing #134 with Develop branch.

@jyejare jyejare self-assigned this Aug 1, 2024
@jyejare jyejare force-pushed the ocp_cluster_alignment branch 2 times, most recently from bb819b6 to 30d9792 Compare August 3, 2024 13:24
@@ -11,27 +11,44 @@
def cleanup(**kwargs):
is_dry_run = kwargs.get("dry_run", False)
Copy link
Contributor

Choose a reason for hiding this comment

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

I know it's not related, but don't we want to set dry_run to true by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

For making it dummy proof

awscleanup.ocps.cleanup()
if is_dry_run:
echo_dry(dry_data)
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

Might not want to use else since the cleanup can be set to execute OCPs and other resources as well (or use kwargs["_all"])

Comment on lines +17 to +18
# VMsContainer = namedtuple('VMsCotainer', ['delete', 'stop', 'skip'])
# return VMsContainer(self._delete, self._stop, self._skip)
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like a leftover :)

Suggested change
# VMsContainer = namedtuple('VMsCotainer', ['delete', 'stop', 'skip'])
# return VMsContainer(self._delete, self._stop, self._skip)

Comment on lines +53 to +54
if is_dry_run:
echo_dry(dry_data)
Copy link
Contributor

Choose a reason for hiding this comment

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

Following the last comment, since the cleanup can be executed on multiple resources (OCPs and others), I think the if is_dry_run: component should be outside both sections and appear once only, post all resources cleanup executions.

Suggested change
if is_dry_run:
echo_dry(dry_data)
if is_dry_run:
echo_dry(dry_data)

@jyejare
Copy link
Collaborator Author

jyejare commented Aug 8, 2024

Will take a look on the comments tomorrow in brief but did you see any logical failures via static check or execution ?

@oharan2
Copy link
Contributor

oharan2 commented Aug 13, 2024

Will take a look on the comments tomorrow in brief but did you see any logical failures via static check or execution ?

Other than the "else" I noted (will break any cleanup contains with both OCPs and other types of AWS resources);

The only thing I suscpected is here, needs to be approachable in any case.

I thought it maybe should be self.dry_data['OCPS']['delete'] when self.dry_data[] will be set in the level of providerclenaup instead of here. Unless it's already verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants