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

Bug 1804596: Continue deleting the instance if its ports haven't been destroyed #89

Merged
merged 2 commits into from
May 13, 2020

Conversation

Fedosin
Copy link

@Fedosin Fedosin commented Apr 28, 2020

If the instance is not Active, then when we try to delete it, Neutron may fail to delete its ports, and therefore we can't delete the instance after that.

This patch accepts the fact that ports may not be removed, and continues deleting the instance anyway.

… destroyed

If the instance is not Active, then when we try to delete it, Neutron
may fail to delete its ports, and therefore we can't delete the instance
after that.

This patch accepts the fact that ports may not be removed, and continues
deleting the instance anyway.
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Apr 28, 2020
@openshift-ci-robot
Copy link

@Fedosin: This pull request references Bugzilla bug 1804596, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1804596: Continue deleting the instance if its ports haven't been destroyed

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 28, 2020
@iamemilio
Copy link

iamemilio commented Apr 29, 2020

The code looks good, but is there a way to handle the deletion hanging without orphaning resources? Maybe a retry loop or something like that?

@Fedosin
Copy link
Author

Fedosin commented Apr 30, 2020

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 30, 2020
@iamemilio
Copy link

In Slack we had agreed that a good middle ground would be to add a custom tag to the ports so the admin knows they were created by CAPO. This should make it much easier to find them in a clean up script.

@iamemilio
Copy link

I put some more thought into this. I am going to make an additional pull request to the installer that adds a tag for all resources created by CAPO: $clusterID-machine-infrastructure. On top of that, this PR should be modified to add a tag: orphaned to all resources it fails to delete and subsequently orphans. This allows customers to make a script to clean up any resources tagged orphaned + $clusterID-machine-infrastructure

@@ -756,7 +756,7 @@ func (is *InstanceService) InstanceCreate(clusterName string, name string, clust
return serverToInstance(server), nil
}

func (is *InstanceService) InstanceDelete(id string) error {
func (is *InstanceService) deleterInstancePorts(id string) error {
Copy link
Member

Choose a reason for hiding this comment

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

Is the deleterInstancePorts function name a typo? should it be deleteInstancePorts instead?

@pierreprinetti
Copy link
Member

pierreprinetti commented May 7, 2020

add a tag to all resources it fails to delete

I understand that tagging makes sense in this particular case, but in my (limited) experience many resources that we fail to delete we would also fail to tag. I am reluctant to give the impression that running a script based on "tag:orphaned" will reliably collect all the orphaned ports

@iamemilio
Copy link

That is a good point. The alternative is that we just leave the resources orphaned in their cluster until this gets fixed in Nova. :) not ideal either way

@pierreprinetti
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 13, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Fedosin, pierreprinetti

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Fedosin,pierreprinetti]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@iamemilio
Copy link

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 13, 2020
@pierreprinetti
Copy link
Member

/hold
Let's wait for openstack-e2e and @Fedosin

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 13, 2020
@Fedosin
Copy link
Author

Fedosin commented May 13, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 13, 2020
@openshift-merge-robot openshift-merge-robot merged commit d9455b6 into openshift:master May 13, 2020
@openshift-ci-robot
Copy link

@Fedosin: All pull requests linked via external trackers have merged: openshift/cluster-api-provider-openstack#89. Bugzilla bug 1804596 has been moved to the MODIFIED state.

In response to this:

Bug 1804596: Continue deleting the instance if its ports haven't been destroyed

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.

pierreprinetti pushed a commit to shiftstack/cluster-api-provider-openstack that referenced this pull request Apr 22, 2024
* Implemented bootstrap tokens via cluster-bootstrap

Therefore, I added new dependency to k8s.io/cluster-bootstrap.

Shelling out to kubeadm from token generation is now removed from
machineactuator.go. I used the tools of cluster-bootstrap to generate a
kubeadm compliant token name and create a secret out of it.

This implementation does not use the ways kubeadm currently uses,
because it would pull a hole bunch of other dependencies in, which are
IMHO not needed at that point.

Fixes openshift#78

* Renamed TokenExpiration to TokenTTL

* Increased TokenTTL to 60 minutes

* Added link to inspiration of bootstrap/token.go

* Changed error handling to panic and removed needless lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants