Skip to content

Backport of task env: add NOMAD_UNIX_ADDR var into release/1.10.x #26034

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

Merged

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #25598 to be assessed for backporting due to the inclusion of the label backport/1.10.x.

The below text is copied from the body of the original PR.


I keep thinking of this, and finally I'm doin it. Allows for easier usage in task setup:

task "nomad-cli" {
  driver = "raw_exec"
  config { ... run `nomad` commands ... }
  identity {
    env = true
  }
  env {
    NOMAD_ADDR = "${NOMAD_UNIX_ADDR}"
    # instead of this, which requires you to know the right "unix://" prefix, and socket location
    NOMAD_ADDR = "unix://${NOMAD_SECRETS_DIR}/api.sock"
  }
}

I named it "_UNIX_ADDR" instead of "_ADDR_UNIX" because I figure there may be services out there called "UNIX" that would cause a name collision, but I'm open to other names.

E2E spot check on my linux laptop:

    --- PASS: TestTaskAPI/testTaskAPI_NomadCLI (1.12s)

Overview of commits

@gulducat gulducat merged commit e7cf8ca into release/1.10.x Jul 7, 2025
32 checks passed
@gulducat gulducat deleted the backport/env-nomad-unix-addr/hardly-glad-urchin branch July 7, 2025 19:21
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.

2 participants