Merge pull request #9683 from hashicorp/dnephin/fix-zombie-service-dereg

local: use agent token to deregister services
pull/9799/head
Daniel Nephin 4 years ago committed by GitHub
commit b1d3c8002b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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.
```

@ -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
}

Loading…
Cancel
Save