always return false if error not nil in Get(pcb)

Change-Id: I37bd4d8948a8a5c0017966958547904595b28119
pull/6/head
m1093782566 2016-09-08 09:46:48 +08:00
parent 7c27a2686f
commit 13ce13664d
1 changed files with 3 additions and 5 deletions

View File

@ -166,15 +166,13 @@ type apiServerPetClient struct {
// Get gets the pet in the pcb from the apiserver.
func (p *apiServerPetClient) Get(pet *pcb) (*pcb, bool, error) {
found := true
ns := pet.parent.Namespace
pod, err := podClient(p.c, ns).Get(pet.pod.Name)
if errors.IsNotFound(err) {
found = false
err = nil
return nil, false, nil
}
if err != nil || !found {
return nil, found, err
if err != nil {
return nil, false, err
}
realPet := *pet
realPet.pod = pod