diff --git a/.changelog/9683.txt b/.changelog/9683.txt new file mode 100644 index 000000000000..541f9264c7fb --- /dev/null +++ b/.changelog/9683.txt @@ -0,0 +1,3 @@ +```release-notes:improvement +client: when a client agent is attempting to dereigster a service, anddoes not have access to the ACL token used to register a service, attempt to use the agent token instead of the default user token. If no agent token is set, fall back to the default user token. +``` diff --git a/agent/local/state.go b/agent/local/state.go index 6f0b779fc66e..b2382ed5b1b6 100644 --- a/agent/local/state.go +++ b/agent/local/state.go @@ -243,7 +243,7 @@ func (l *State) serviceToken(id structs.ServiceID) string { token = s.Token } if token == "" { - token = l.tokens.UserToken() + token = l.tokens.AgentToken() } return token } @@ -457,7 +457,7 @@ func (l *State) checkToken(id structs.CheckID) string { token = c.Token } if token == "" { - token = l.tokens.UserToken() + token = l.tokens.AgentToken() } return token }