mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
clear the token
This commit is contained in:
@@ -21,7 +21,7 @@ func (s *Server) ResolveToken(secretID string) (*acl.ACL, error) {
|
||||
|
||||
// Check if the secret ID is the leader secret ID, in which case treat it as
|
||||
// a management token.
|
||||
if secretID == s.getLeaderAcl() {
|
||||
if leaderAcl := s.getLeaderAcl(); leaderAcl != "" && secretID == leaderAcl {
|
||||
return acl.ManagementACL, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -522,6 +522,9 @@ func (s *Server) periodicUnblockFailedEvals(stopCh chan struct{}) {
|
||||
// revokeLeadership is invoked once we step down as leader.
|
||||
// This is used to cleanup any state that may be specific to a leader.
|
||||
func (s *Server) revokeLeadership() error {
|
||||
// Clear the leader token since we are no longer the leader.
|
||||
s.setLeaderAcl("")
|
||||
|
||||
// Disable the plan queue, since we are no longer leader
|
||||
s.planQueue.SetEnabled(false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user