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

local: use agent token to deregister services #9683

Merged
merged 1 commit into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/9683.txt
Original file line number Diff line number Diff line change
@@ -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.
```
4 changes: 2 additions & 2 deletions agent/local/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down