Skip to content

Commit

Permalink
Use key.ClusterName when storing a key in memory
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejtokarcik authored and xacrimon committed Mar 12, 2021
1 parent 948f574 commit 8e4efc1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/client/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,9 @@ func NewMemLocalKeyStore(dirPath string) (*MemLocalKeyStore, error) {
// AddKey writes a key to the underlying key store.
func (s *MemLocalKeyStore) AddKey(proxy string, username string, key *Key) error {
s.inMem[keyIndex{proxyHost: proxy, username: username}] = key
if key.ClusterName != "" {
s.inMem[keyIndex{proxyHost: proxy, username: username, clusterName: key.ClusterName}] = key
}
return nil
}

Expand All @@ -785,7 +788,6 @@ func (s *MemLocalKeyStore) GetKey(proxy, username string, opts ...KeyOption) (*K
return nil, trace.Wrap(err)
}
}

return entry, nil
}

Expand Down

0 comments on commit 8e4efc1

Please sign in to comment.