зеркало из https://github.com/docker/hub-tool.git
fix the verbose logout error displayed when the user is already disconnected
Signed-off-by: Moshe Beladev <moshebe123@gmail.com>
This commit is contained in:
Родитель
adf27a4392
Коммит
1aa5deb383
|
@ -124,8 +124,24 @@ func (s *store) Store(auth Auth) error {
|
|||
})
|
||||
}
|
||||
|
||||
func (s *store) exists(serverAddress string) (bool, error) {
|
||||
authConfig, err := s.s.Get(serverAddress)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if (clitypes.AuthConfig{}) == authConfig {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (s *store) Erase() error {
|
||||
if err := s.s.Erase(hubToolKey); err != nil {
|
||||
if found, findErr := s.exists(hubToolKey); findErr == nil && !found {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
if err := s.s.Erase(hubToolRefreshTokenKey); err != nil {
|
||||
|
|
Загрузка…
Ссылка в новой задаче