Skip to content

Commit

Permalink
Merge 2dced0a into backport/consul-token-delete-api/neatly-summary-ki…
Browse files Browse the repository at this point in the history
…ngfish
  • Loading branch information
hc-github-team-nomad-core authored Jul 7, 2023
2 parents 6ae902d + 2dced0a commit b4e272e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/17847.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
consul: Fixed a bug where Nomad would repeatedly try to revoke successfully revoked SI tokens
```
4 changes: 3 additions & 1 deletion nomad/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,10 @@ func (c *consulACLsAPI) singleRevoke(ctx context.Context, accessor *structs.SITo
return err
}

// Consul will no-op the deletion of a non-existent token (no error)
_, err := c.aclClient.TokenDelete(accessor.AccessorID, &api.WriteOptions{Namespace: accessor.ConsulNamespace})
if err != nil && strings.Contains(err.Error(), "Cannot find token to delete") {
return nil // Consul will error when deleting a non-existent token
}
return err
}

Expand Down

0 comments on commit b4e272e

Please sign in to comment.