Merge pull request #258 from runcom/fix-logrus-2

server: fix calls to logrus again
This commit is contained in:
Mrunal Patel 2016-12-11 10:00:15 -08:00 committed by GitHub
commit 5142b8a4d7

View file

@ -200,12 +200,12 @@ func (s *Server) reservePodName(id, name string) (string, error) {
if err == registrar.ErrNameReserved { if err == registrar.ErrNameReserved {
id, err := s.podNameIndex.Get(name) id, err := s.podNameIndex.Get(name)
if err != nil { if err != nil {
logrus.Warnf("name %s already reserved for %s", name, id) logrus.Warnf("conflict, pod name %q already reserved", name)
return "", err return "", err
} }
return "", fmt.Errorf("conflict, name %s already reserved", name) return "", fmt.Errorf("conflict, name %q already reserved for pod %q", name, id)
} }
return "", fmt.Errorf("error reserving name %s", name) return "", fmt.Errorf("error reserving pod name %q", name)
} }
return name, nil return name, nil
} }
@ -219,12 +219,12 @@ func (s *Server) reserveContainerName(id, name string) (string, error) {
if err == registrar.ErrNameReserved { if err == registrar.ErrNameReserved {
id, err := s.ctrNameIndex.Get(name) id, err := s.ctrNameIndex.Get(name)
if err != nil { if err != nil {
logrus.Warnf("get reserved name %s failed", name) logrus.Warnf("conflict, ctr name %q already reserved", name)
return "", err return "", err
} }
return "", fmt.Errorf("conflict, name %s already reserved for %s", name, id) return "", fmt.Errorf("conflict, name %q already reserved for ctr %q", name, id)
} }
return "", fmt.Errorf("error reserving name %s", name) return "", fmt.Errorf("error reserving ctr name %s", name)
} }
return name, nil return name, nil
} }