mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
Catch 404 and return exists=false from GetTCPLoadBalancer
Previouly getVipByName treated 404 like any other unexpected error return and passed it up the chain. This caused the "if ErrNotFound then exists=false" logic in GetTCPLoadBalancer to never fire. This change teaches getVipByName to return ErrNotFound on a 404 server response.
This commit is contained in:
parent
5520386b18
commit
6491922562
@ -463,6 +463,11 @@ func getVipByName(client *gophercloud.ServiceClient, name string) (*vips.Virtual
|
||||
return true, nil
|
||||
})
|
||||
if err != nil {
|
||||
if e, ok := err.(*gophercloud.UnexpectedResponseCodeError); ok {
|
||||
if e.Actual == http.StatusNotFound {
|
||||
return nil, ErrNotFound
|
||||
}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user