mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
IsNotFound should check ErrDefault404 and ErrUnexpectedResponseCode
Related to: #60658 #60976 Refer to: https://github.com/gophercloud/gophercloud/pull/103
This commit is contained in:
parent
9ad5ea2d61
commit
0da1660653
@ -605,8 +605,17 @@ func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool) {
|
||||
}
|
||||
|
||||
func isNotFound(err error) bool {
|
||||
e, ok := err.(*gophercloud.ErrUnexpectedResponseCode)
|
||||
return ok && e.Actual == http.StatusNotFound
|
||||
if _, ok := err.(gophercloud.ErrDefault404); ok {
|
||||
return true
|
||||
}
|
||||
|
||||
if errCode, ok := err.(gophercloud.ErrUnexpectedResponseCode); ok {
|
||||
if errCode.Actual == http.StatusNotFound {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// Zones indicates that we support zones
|
||||
|
Loading…
Reference in New Issue
Block a user