mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 13:02:14 +00:00
Merge pull request #32030 from m1093782566/m109-clean-get-pet-code
Automatic merge from submit-queue [Pet Set] Fix logical breaking of apiServerPetClient.Get(*pcb) <!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md 2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md 3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes --> **What this PR does / why we need it**: addresses #32031
This commit is contained in:
commit
2462f43798
@ -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
Block a user