Skip to content

Commit

Permalink
Merge pull request #9683 from hashicorp/dnephin/fix-zombie-service-dereg
Browse files Browse the repository at this point in the history
local: use agent token to deregister services
  • Loading branch information
dnephin authored and dizzyup committed Apr 21, 2021
1 parent b11a65a commit 8e8bd3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 8e8bd3a

Please sign in to comment.