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

nomad service does not handle globbed namespaces. #18831

Closed
the-maldridge opened this issue Oct 23, 2023 · 3 comments · Fixed by #18836
Closed

nomad service does not handle globbed namespaces. #18831

the-maldridge opened this issue Oct 23, 2023 · 3 comments · Fixed by #18836

Comments

@the-maldridge
Copy link

Nomad version

$ nomad version
Nomad v1.6.2
Revision 8af70885c02ab921dedbdf6bc406a1e886866f80

Operating system and Environment details

Void Linux on amd64

Issue

Calling nomad service info with the environment variable NOMAD_NAMESPACE set to * does not result in the named service being matched at all, even if it is an exact string match.

Reproduction steps

Try to get info on a service with the namespace set to the wildcard.

Expected Result

I expect a search to be performed across all namespaces I have access to and match to happen across the services returned from this set, similar to how other commands work cross-namespace.

Actual Result

Nomad reports the service could not be found.

Job file (if appropriate)

N/A

Nomad Server logs (if appropriate)

N/A

Nomad Client logs (if appropriate)

N/A

@tgross
Copy link
Member

tgross commented Oct 23, 2023

Hi @the-maldridge! I took a quick look at this and it looks like the nomad service info command is missing the logic we do for other "get" commands. Our "list" commands (ex. nomad job status without a specific job ID) support using the wildcard in the API request handler. Whereas for the "get" commands (ex. nomad job status :jobid), we first query the list endpoint to disambiguate the specific job ID, and then make the get request with the appropriate namespace.

I've got a PR up in #18836 to fix this.

@tgross tgross self-assigned this Oct 23, 2023
@tgross tgross added this to the 1.7.0 milestone Oct 23, 2023
tgross added a commit that referenced this issue Oct 23, 2023
The `nomad service info` command doesn't support using a wildcard namespace with
a prefix match, the way that we do for many other commands. Update the command
to do a prefix match list query for the services before making the get query.

Fixes: #18831
tgross added a commit that referenced this issue Oct 23, 2023
…18836)

The `nomad service info` command doesn't support using a wildcard namespace with
a prefix match, the way that we do for many other commands. Update the command
to do a prefix match list query for the services before making the get query.

Fixes: #18831
@tgross
Copy link
Member

tgross commented Oct 23, 2023

Done in #18836 and will ship in the upcoming 1.7

@the-maldridge
Copy link
Author

Wow that was fast! Thanks for the quick turnaround on this.

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

Successfully merging a pull request may close this issue.

2 participants