fix(openstack): determine ports to delete based on tags
This will determine the ports to delete when deleting an InstanceGroup in OpenStack based on the tags, rather than comparing the prefix of the name of the port to a pattern.
The current approach for deleting ports associated with an InstanceGroup in OpenStack can be problematic.
For example, when creating an InstanceGroup called worker and another one called worker-2. Some of the ports kOps creates for those groups will look like this:
port-worker-2-1-<clusterName>port-worker-2-2-<clusterName>port-worker-1-<clusterName>port-worker-2-<clusterName>port-worker-20-<clusterName>
Deleting the worker-2 IG will ultimately delete all the ports prefixed with port-worker-2, which means that kOps will also delete ports of the worker IG.
TODO:
- [x] Write tests
Hi @ederst. Thanks for your PR.
I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
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.
/ok-to-test
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
@ederst: 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 |
|---|---|---|---|---|
| pull-kops-e2e-cni-flannel | 33c6fd3d0906667577288af6274f91900d8d1eff | link | true | /test pull-kops-e2e-cni-flannel |
| pull-kops-e2e-gce-cni-calico | 33c6fd3d0906667577288af6274f91900d8d1eff | link | true | /test pull-kops-e2e-gce-cni-calico |
| pull-kops-e2e-gce-cni-kindnet | 33c6fd3d0906667577288af6274f91900d8d1eff | link | true | /test pull-kops-e2e-gce-cni-kindnet |
| pull-kops-e2e-k8s-aws-amazonvpc-u2404 | 33c6fd3d0906667577288af6274f91900d8d1eff | link | true | /test pull-kops-e2e-k8s-aws-amazonvpc-u2404 |
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
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.
/retest
@hakman @zetaab friendly bump (took me some time to finish)
Thanks for the effort @ederst, and sorry for the delay. /lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: hakman
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [hakman]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment