-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Nomad version
v1.5.0
Operating system and Environment details
Ubuntu 22.04.2 LTS
Issue
The documentation for the nomad login command and the integration guide here state that the type flag is optional if an admin has configured a default, however this is not the case.
Line 117 in login.go explicitly rejects any calls to nomad login that don't have OIDC set as the type:
switch l.authMethodType {
case api.ACLAuthMethodTypeOIDC:
default:
l.Ui.Error(fmt.Sprintf("Unsupported authentication type %q", l.authMethodType))
return 1
}There is a check further down for a default auth method, at line 143 that will set the type to be the type of the default auth method, but that section of the code is never reached because the switch statement above returns an error before it can try to determine the default type.
Reproduction steps
- Register an auth method with Nomad (i.e. following this guide)
- Make sure the auth method is set as default (
nomad acl auth-method info vault) - Try to run
nomad loginwithout specifying the type, you'll receive an errorUnsupported authentication type ""
Expected Result
It should be selecting the default auth method and using the type from that. These is code defined in the command to do so, but the switch statement further up cancels it out before it can try to determine the default.
Actual Result
Unsupported authentication type ""
Metadata
Metadata
Assignees
Labels
Type
Projects
Status