openstack: don't look up VMs by project ID.#265
Open
oseiberts11 wants to merge 2 commits intohashicorp:masterfrom
Open
openstack: don't look up VMs by project ID.#265oseiberts11 wants to merge 2 commits intohashicorp:masterfrom
oseiberts11 wants to merge 2 commits intohashicorp:masterfrom
Conversation
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.
Author
|
ping! |
Author
|
ping! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a consul configuration, you can have this to discover the consul servers in an OpenStack project:
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 .