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

STOR-1353: Cleanup GCP Filestore instances on destroy #7251

Merged

Conversation

tsmetana
Copy link
Member

Make use of openshift/gcp-filestore-csi-driver#17 and openshift/gcp-filestore-csi-driver-operator#38 to cleanup also GCP Filestore instances created dynamically by the CSI Filestore driver.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 15, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jun 15, 2023

@tsmetana: This pull request references STOR-1353 which is a valid jira issue.

In response to this:

Make use of openshift/gcp-filestore-csi-driver#17 and openshift/gcp-filestore-csi-driver-operator#38 to cleanup also GCP Filestore instances created dynamically by the CSI Filestore driver.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 15, 2023
@tsmetana tsmetana force-pushed the wip-filestore-destroy-rebased branch from 0279f6e to 2291fe1 Compare June 26, 2023 10:39
@tsmetana
Copy link
Member Author

/retest

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 4, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Oct 4, 2023

@tsmetana: This pull request references STOR-1353 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.15.0" version, but no target version was set.

In response to this:

Make use of openshift/gcp-filestore-csi-driver#17 and openshift/gcp-filestore-csi-driver-operator#38 to cleanup also GCP Filestore instances created dynamically by the CSI Filestore driver.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 14, 2024
@sadasu
Copy link
Contributor

sadasu commented Mar 25, 2024

@tsmetana are you still interested in this PR?

@tsmetana tsmetana force-pushed the wip-filestore-destroy-rebased branch from 2291fe1 to 5019bcf Compare April 16, 2024 13:00
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 16, 2024
@tsmetana
Copy link
Member Author

@tsmetana are you still interested in this PR?

Sorry for the slow response: I failed to test the PR (I seem to be unable to install custom GCP cluster), but yes, we still would like to have this included. It's not super-urgent, but would be good to have to keep all the platforms behaving consistently.

@tsmetana
Copy link
Member Author

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 16, 2024
@tsmetana tsmetana force-pushed the wip-filestore-destroy-rebased branch from 5019bcf to 65fe111 Compare April 16, 2024 15:48
@tsmetana
Copy link
Member Author

/retest

@tsmetana
Copy link
Member Author

I'm not retesting the ci/prow/okd-e2e-aws-ovn-upgrade job: looks like this has never passed.

@tsmetana tsmetana changed the title WIP: STOR-1353: Cleanup GCP Filestore instances on destroy STOR-1353: Cleanup GCP Filestore instances on destroy Apr 24, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 24, 2024
@tsmetana
Copy link
Member Author

I seem to be unable to install GCP with my patched installer. However I think the patch should be safe enough not to break things.

pkg/destroy/gcp/filestore.go Outdated Show resolved Hide resolved
pkg/destroy/gcp/filestore.go Show resolved Hide resolved
@tsmetana tsmetana force-pushed the wip-filestore-destroy-rebased branch 2 times, most recently from 2539c86 to 2fbc97f Compare April 29, 2024 11:46
pkg/destroy/gcp/filestore.go Outdated Show resolved Hide resolved
pkg/destroy/gcp/filestore.go Outdated Show resolved Hide resolved
pkg/destroy/gcp/filestore.go Outdated Show resolved Hide resolved
pkg/destroy/gcp/filestore.go Outdated Show resolved Hide resolved
_, err := instSvc.Delete(item.name).Context(ctx).Do()
if err != nil && isForbidden(err) {
o.deletePendingItems(item.typeName, []cloudResource{item})
return fmt.Errorf("Insufficient permissions to delete filestore %s: giving up", item.name)
Copy link
Contributor

Choose a reason for hiding this comment

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

the linter is complaining about the caps. If we're not failing on missing perms, should this be an error, or should this be a logrus Warning? (in which case, with logrus warning it should stay capitalized).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm unsure myself about this part. The uninstallation can't fail as such, so we only need some way to inform the user the resource deletion failed. Perhaps logging a warning and returning an error would work.

Copy link
Contributor

Choose a reason for hiding this comment

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

as the error doesn't stop the destroyer, this is fine. just drop the caps to appease the linter

Suggested change
return fmt.Errorf("Insufficient permissions to delete filestore %s: giving up", item.name)
return fmt.Errorf("insufficient permissions to delete filestore %s: giving up", item.name)

There was one other failure in go-lint that needed to be resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

I have added a log message (so the user is warned when the deletion fails because of missing permissions) and changed the character case for the error.

The other linter failure was caused by the new isForbidden function that now takes a different error type so copying the isNoOp was apparently incorrect.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to explain the lint error: at some point we changed the linter we use but we limited the reporting to a certain commit and all following. That's why when you used existing code as a basis, the linter complained.

@tsmetana tsmetana force-pushed the wip-filestore-destroy-rebased branch from 47c36f6 to 8eac404 Compare May 13, 2024 11:13
@tsmetana
Copy link
Member Author

/retest

@patrickdillon
Copy link
Contributor

/lgtm
/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label May 14, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2024
@r4f4
Copy link
Contributor

r4f4 commented May 25, 2024

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 25, 2024
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD c4fa054 and 2 for PR HEAD 8eac404 in total

@r4f4
Copy link
Contributor

r4f4 commented May 26, 2024

/override ci/prow/okd-images
Known issue

Copy link
Contributor

openshift-ci bot commented May 26, 2024

@r4f4: Overrode contexts on behalf of r4f4: ci/prow/okd-images

In response to this:

/override ci/prow/okd-images
Known issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 3204a5a and 1 for PR HEAD 8eac404 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 267642b and 0 for PR HEAD 8eac404 in total

Copy link
Contributor

openshift-ci bot commented May 27, 2024

@tsmetana: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-e2e-aws-ovn 2291fe1 link false /test okd-e2e-aws-ovn
ci/prow/okd-scos-e2e-aws-ovn 2291fe1 link false /test okd-scos-e2e-aws-ovn
ci/prow/terraform-verify-vendor 2291fe1 link true /test terraform-verify-vendor
ci/prow/terraform-images 2291fe1 link true /test terraform-images
ci/prow/altinfra-openstack-capi-manifests 2291fe1 link true /test altinfra-openstack-capi-manifests
ci/prow/okd-e2e-aws-ovn-upgrade 8eac404 link false /test okd-e2e-aws-ovn-upgrade

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci-robot
Copy link
Contributor

/hold

Revision 8eac404 was retested 3 times: holding

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 27, 2024
@tsmetana
Copy link
Member Author

Thanks for the reviews and the help with this PR. After some discussion with the Storage team I need to keep this on hold: Filestore would behave differently from everything else, which is rather suboptimal, and we'd like to have it also properly documented and tested but there's no time for it in the upcoming release. :(

@tsmetana
Copy link
Member Author

tsmetana commented Jun 3, 2024

/hold cancel

Let's try again in the next relase.

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 3, 2024
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD d6fa028 and 2 for PR HEAD 8eac404 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 28401d0 and 1 for PR HEAD 8eac404 in total

@openshift-merge-bot openshift-merge-bot bot merged commit 3a7f60a into openshift:master Jun 3, 2024
23 of 24 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-installer-altinfra-container-v4.17.0-202406031613.p0.g3a7f60a.assembly.stream.el9 for distgit ose-installer-altinfra.
All builds following this will include this PR.

@p0lyn0mial
Copy link

FYI: It looks like this PR broke a few CI jobs.

These jobs are currently failing on Filestores: error retrieving filestore instances: googleapi: Error 403: Cloud Filestore API has not been used in project.

Are we okay with reverting this PR to unblock failing CI jobs?

@tsmetana
Copy link
Member Author

tsmetana commented Jun 4, 2024

Are we okay with reverting this PR to unblock failing CI jobs?

Yeah. I think it's the best solution. I will take a look a the failed jobs and see if I can fix the PR to make them happy.

@p0lyn0mial
Copy link

Yeah. I think it's the best solution. I will take a look a the failed jobs and see if I can fix the PR to make them happy.

@tsmetana thanks, are you also going to prepare a revert PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants