Skip to content

openstack: don't look up VMs by project ID.#265

Open
oseiberts11 wants to merge 2 commits intohashicorp:masterfrom
syseleven:os-allow-auth-with-project-name
Open

openstack: don't look up VMs by project ID.#265
oseiberts11 wants to merge 2 commits intohashicorp:masterfrom
syseleven:os-allow-auth-with-project-name

Conversation

@oseiberts11
Copy link
Copy Markdown

@oseiberts11 oseiberts11 commented Feb 28, 2025

In a consul configuration, you can have this to discover the consul servers in an OpenStack project:

"retry_join": ["provider=os tag_key=role tag_value=consulserver"]

Most of the usual OS_* environment variables are used to authenticate to OpenStack. Unfortunately you can't specify the project NAME to authenticate with, when finding VMs with the given tag key and value. It only wants to use the project ID, and if it is not given, it tries a "somewhat ususal" (ahem) way to find it.

Apart from the authentication, the project ID was used when listing and filtering the VMs. There is no need to specify the project ID to find VMs. By default you only see the VMs of the project that you authenticated with anyway. (And there was no way in the discover code to auth with one project and look up another.)

Finding the ID is annoying if you want to auth by project name, which was not even possible before.

Since we don't need to obtain the ID, we can get rid of the "somewhat ususal" (ahem) way to obtain it from the metadata service. When trying to use the metadata service, this assumes that you are running inside a VM in openstack, which is a pretty dubious assumption, and not our use case.

This merge request replaces #263 .

There is no need to specify the project ID to find VMs. By default you
only see the VMs of the project that you authenticated with anyway.
(And there was no way in the discover code to auth with one project and
look up another.) Finding the ID is annoying if you want to auth by
project name, which was not even possible before.
Since we don't *need* to obtain the ID, we can get rid of the somewhat
ususal way to obtain it from the metadata service.
@oseiberts11
Copy link
Copy Markdown
Author

ping!

@oseiberts11
Copy link
Copy Markdown
Author

ping!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant