variables: fix access to variables for poststop tasks (#19270)

In the recent auth refactor, we accidentally fixed a bug where poststop tasks
would not get access to Variables. Fix this same bug for backports by ensuring
that we use client-terminal status and not server-terminal status to enforce
access.
This commit is contained in:
Tim Gross 2023-12-01 13:01:48 -05:00 committed by GitHub
parent c7086d5a96
commit 413728fcde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

3
.changelog/19270.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
variables: Fixed a bug where poststop tasks were not allowed access to Variables
```

View File

@ -247,7 +247,7 @@ func (s *Server) VerifyClaim(token string) (*structs.IdentityClaims, error) {
} }
// the claims for terminal allocs are always treated as expired // the claims for terminal allocs are always treated as expired
if alloc.TerminalStatus() { if alloc.ClientTerminalStatus() {
return nil, fmt.Errorf("allocation is terminal") return nil, fmt.Errorf("allocation is terminal")
} }