Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
fcc9f166
Unverified
Commit
fcc9f166
authored
May 28, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 28, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #78298 from andyzhangx/azure-retry-issue
fix azure retry issue when return 2XX with error
parents
6a5fa6ca
8a45ba19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
azure_backoff.go
.../src/k8s.io/legacy-cloud-providers/azure/azure_backoff.go
+3
-2
azure_backoff_test.go
...k8s.io/legacy-cloud-providers/azure/azure_backoff_test.go
+5
-0
No files found.
staging/src/k8s.io/legacy-cloud-providers/azure/azure_backoff.go
View file @
fcc9f166
...
@@ -596,8 +596,9 @@ func shouldRetryHTTPRequest(resp *http.Response, err error) bool {
...
@@ -596,8 +596,9 @@ func shouldRetryHTTPRequest(resp *http.Response, err error) bool {
return
false
return
false
}
}
// processHTTPRetryResponse : return true means stop retry, false means continue retry
func
(
az
*
Cloud
)
processHTTPRetryResponse
(
service
*
v1
.
Service
,
reason
string
,
resp
*
http
.
Response
,
err
error
)
(
bool
,
error
)
{
func
(
az
*
Cloud
)
processHTTPRetryResponse
(
service
*
v1
.
Service
,
reason
string
,
resp
*
http
.
Response
,
err
error
)
(
bool
,
error
)
{
if
resp
!=
nil
&&
isSuccessHTTPResponse
(
resp
)
{
if
err
==
nil
&&
resp
!=
nil
&&
isSuccessHTTPResponse
(
resp
)
{
// HTTP 2xx suggests a successful response
// HTTP 2xx suggests a successful response
return
true
,
nil
return
true
,
nil
}
}
...
@@ -620,7 +621,7 @@ func (az *Cloud) processHTTPRetryResponse(service *v1.Service, reason string, re
...
@@ -620,7 +621,7 @@ func (az *Cloud) processHTTPRetryResponse(service *v1.Service, reason string, re
}
}
func
(
az
*
Cloud
)
processHTTPResponse
(
service
*
v1
.
Service
,
reason
string
,
resp
*
http
.
Response
,
err
error
)
error
{
func
(
az
*
Cloud
)
processHTTPResponse
(
service
*
v1
.
Service
,
reason
string
,
resp
*
http
.
Response
,
err
error
)
error
{
if
isSuccessHTTPResponse
(
resp
)
{
if
err
==
nil
&&
isSuccessHTTPResponse
(
resp
)
{
// HTTP 2xx suggests a successful response
// HTTP 2xx suggests a successful response
return
nil
return
nil
}
}
...
...
staging/src/k8s.io/legacy-cloud-providers/azure/azure_backoff_test.go
View file @
fcc9f166
...
@@ -120,6 +120,11 @@ func TestProcessRetryResponse(t *testing.T) {
...
@@ -120,6 +120,11 @@ func TestProcessRetryResponse(t *testing.T) {
stop
:
true
,
stop
:
true
,
},
},
{
{
code
:
http
.
StatusOK
,
err
:
fmt
.
Errorf
(
"some error"
),
stop
:
false
,
},
{
code
:
399
,
code
:
399
,
stop
:
true
,
stop
:
true
,
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment