mirror of https://github.com/k3s-io/k3s
Merge pull request #61002 from FengyunPan2/fix-isNotFound
Automatic merge from submit-queue (batch tested with PRs 60898, 60912, 60753, 61002, 60796). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. IsNotFound should check ErrDefault404 and ErrUnexpectedResponseCode Related to: #60658 #60976 Refer to: https://github.com/gophercloud/gophercloud/pull/103/files#diff-e8ad71423a1527851f282515739eecc2R265 **Release note**: ```release-note NONE ```pull/8/head
commit
e3ac40264f
|
@ -602,8 +602,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