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

provider: don't load namespace from env var #271

Merged
merged 3 commits into from
Jun 9, 2022
Merged

provider: don't load namespace from env var #271

merged 3 commits into from
Jun 9, 2022

Conversation

lgfa29
Copy link
Contributor

@lgfa29 lgfa29 commented Jun 8, 2022

The Nomad provider doesn't have a global Namespace configuration as each
resource may target a different namespace, but the Nomad API client
default configuration would load a namespace value from the
NOMAD_NAMESPACE automatically.

This caused issues in environments where Terraform runs within a Nomad
allocation, where the value for NOMAD_NAMESPACE is the namespace of the
allocation.

Since the namespace value was never supposed to be set at the provider
level, this change makes sure the Nomad client namespace is always
empty.

Closes #267

lgfa29 added a commit that referenced this pull request Jun 8, 2022
@lgfa29 lgfa29 requested a review from jrasell June 8, 2022 22:06
lgfa29 added a commit that referenced this pull request Jun 8, 2022
lgfa29 added 2 commits June 8, 2022 19:19
The Nomad provider doesn't have a global Namespace configuration as each
resource may target a different namespace, but the Nomad API client
default configuration would load a namespace value from the
NOMAD_NAMESPACE automatically.

This caused issues in environments where Terraform runs within a Nomad
allocation, where the value for NOMAD_NAMESPACE is the namespace of the
allocation.

Since the namespace value was never supposed to be set at the provider
level, this change makes sure the Nomad client namespace is always
empty.
jrasell
jrasell previously approved these changes Jun 9, 2022
Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for looking into this and finding such as nice solution.

@lgfa29 lgfa29 merged commit 5f3cdcb into main Jun 9, 2022
@lgfa29 lgfa29 deleted the b-ns-en-var branch June 9, 2022 14:08
lgfa29 added a commit that referenced this pull request Aug 25, 2022
Allow users to opt-in into loading the NOMAD_NAMESPACE environment
variable. #271 removed this, as this was not intentional, but this value
is used in some workflows.
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.

nomad_job is put in a nonexistent namespace by default
2 participants