Commit 0da16606 authored by FengyunPan2's avatar FengyunPan2

IsNotFound should check ErrDefault404 and ErrUnexpectedResponseCode

Related to: #60658 #60976 Refer to: https://github.com/gophercloud/gophercloud/pull/103
parent 9ad5ea2d
...@@ -605,8 +605,17 @@ func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool) { ...@@ -605,8 +605,17 @@ func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool) {
} }
func isNotFound(err error) bool { func isNotFound(err error) bool {
e, ok := err.(*gophercloud.ErrUnexpectedResponseCode) if _, ok := err.(gophercloud.ErrDefault404); ok {
return ok && e.Actual == http.StatusNotFound return true
}
if errCode, ok := err.(gophercloud.ErrUnexpectedResponseCode); ok {
if errCode.Actual == http.StatusNotFound {
return true
}
}
return false
} }
// Zones indicates that we support zones // Zones indicates that we support zones
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment