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

Pick the right OS server group when creating cloud groups #54

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

ederst
Copy link

@ederst ederst commented Apr 5, 2022

@ederst ederst force-pushed the delete-right-instances-of-an-ig branch from 21dda9f to 080b619 Compare April 5, 2022 16:48
This fixes an issue where kops picks the last server group found on
OpenStack instead of the right one when getting the cloud groups.

For example, lets assume that kops created those server groups and they are returned in the order as shown here by the OpenStack API:

```
cluster-name-bastion
cluster-name-cp-0
cluster-name-worker
````

Now kops looks for nodes associated with the IG "bastion" and the
expected behavior would be that it ends up using "cluster-name-bastion".
However, it will actually end up  associating the cloud group with the
last server group, which is in this case "cluster-name-worker" due to
the reference switching to the last item when the loop is done.

In the worst case this could lead to kops deleting the wrong instances
when deleting an IG.

Not using the server group as a "by reference" argument when building
the cloud group fixes this behavior.
@ederst ederst force-pushed the delete-right-instances-of-an-ig branch from 080b619 to 47a7675 Compare April 13, 2022 08:07
@ederst ederst changed the title Delete right instances of an ig Pick the right OS server group when creating cloud groups Apr 13, 2022
@ederst ederst marked this pull request as ready for review April 13, 2022 08:07
Copy link
Collaborator

@thespoopymrfox thespoopymrfox left a comment

Choose a reason for hiding this comment

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

IWTB

@ederst ederst enabled auto-merge April 13, 2022 08:08
@ederst ederst added the merge label Apr 13, 2022
@ederst ederst merged commit a962040 into release-1.22-bp Apr 13, 2022
@ederst ederst deleted the delete-right-instances-of-an-ig branch April 13, 2022 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants