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

Handle NOMAD_TOKEN automatically #110

Closed
mikenomitch opened this issue Oct 15, 2021 · 3 comments · Fixed by #119
Closed

Handle NOMAD_TOKEN automatically #110

mikenomitch opened this issue Oct 15, 2021 · 3 comments · Fixed by #119
Assignees

Comments

@mikenomitch
Copy link
Contributor

When taking an action on a cluster (ie 'nomad-pack run'), it should automatically use NOMAD_TOKEN to auth the request.

@RickyGrassmuck
Copy link
Contributor

Is there a workaround for this currently? Trying to test out a new pack and I'm just getting 403's when I attempt to plan.

 ➜  promtail git:(main) ✗ env | grep NOMAD
NOMAD_ADDR=https://nomad.svc.example.com
NOMAD_TOKEN=<NOMAD_TOKEN>
 ➜  promtail git:(main) ✗ nomad-pack plan -verbose -var-file=config.vars.hcl promtail
! Failed To Perform Plan

        Error:   403 Forbidden
        Type:    client.GenericOpenAPIError
        Context: 
                 - Registry Name: default
                 - Pack Name: promtail
                 - Pack Ref: latest
                 - Deployment Name: promtail@latest
                 - Template Name: promtail/templates/promtail.nomad.tpl
                 - Job Name: Nomad-Pack-Promtail

@mikenomitch
Copy link
Contributor Author

Hey @rigrassm, sorry there is no workaround for this now. It was just a silly miss on our end since we were developing against our non-ACLed test clusters for the most part. It should be trivial to fix though, so we should be able to push a fix early next week.

If you want to test out the pack code, you could use the render function then manually write that to a file and submit it to Nomad via the standard CLI. Obviously that's not a good flow long term, but it can help you check that everything is valid until we merge the fix.

@RickyGrassmuck
Copy link
Contributor

@mikenomitch No worries, I just went ahead and ran nomad agent -dev on a spare VM and tested against that with no issues. Thanks for getting back to me!

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 a pull request may close this issue.

3 participants