mirror of https://github.com/k3s-io/k3s
always return false if error not nil in Get(pcb)
Change-Id: I37bd4d8948a8a5c0017966958547904595b28119pull/6/head
parent
7c27a2686f
commit
13ce13664d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue