mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
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 ```
This commit is contained in:
commit
e3ac40264f
@ -602,8 +602,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
|
||||||
|
Loading…
Reference in New Issue
Block a user