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
07877159
Unverified
Commit
07877159
authored
Sep 27, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #69124 from tanshanshan/httpcode
replace 200 with http.StatusOK
parents
96965705
acdc4562
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
kube_apiserver_test.go
test/integration/master/kube_apiserver_test.go
+3
-2
metrics_test.go
test/integration/metrics/metrics_test.go
+1
-1
No files found.
test/integration/master/kube_apiserver_test.go
View file @
07877159
...
@@ -19,6 +19,7 @@ package master
...
@@ -19,6 +19,7 @@ package master
import
(
import
(
"encoding/json"
"encoding/json"
"fmt"
"fmt"
"net/http"
"reflect"
"reflect"
"strings"
"strings"
"testing"
"testing"
...
@@ -98,8 +99,8 @@ func TestOpenAPIDelegationChainPlumbing(t *testing.T) {
...
@@ -98,8 +99,8 @@ func TestOpenAPIDelegationChainPlumbing(t *testing.T) {
result
:=
kubeclient
.
RESTClient
()
.
Get
()
.
AbsPath
(
"/swagger.json"
)
.
Do
()
result
:=
kubeclient
.
RESTClient
()
.
Get
()
.
AbsPath
(
"/swagger.json"
)
.
Do
()
status
:=
0
status
:=
0
result
.
StatusCode
(
&
status
)
result
.
StatusCode
(
&
status
)
if
status
!=
200
{
if
status
!=
http
.
StatusOK
{
t
.
Fatalf
(
"GET /swagger.json failed: expected status=%d, got=%d"
,
200
,
status
)
t
.
Fatalf
(
"GET /swagger.json failed: expected status=%d, got=%d"
,
http
.
StatusOK
,
status
)
}
}
raw
,
err
:=
result
.
Raw
()
raw
,
err
:=
result
.
Raw
()
...
...
test/integration/metrics/metrics_test.go
View file @
07877159
...
@@ -54,7 +54,7 @@ func scrapeMetrics(s *httptest.Server) ([]*prometheuspb.MetricFamily, error) {
...
@@ -54,7 +54,7 @@ func scrapeMetrics(s *httptest.Server) ([]*prometheuspb.MetricFamily, error) {
return
nil
,
fmt
.
Errorf
(
"Unable to contact metrics endpoint of master: %v"
,
err
)
return
nil
,
fmt
.
Errorf
(
"Unable to contact metrics endpoint of master: %v"
,
err
)
}
}
defer
resp
.
Body
.
Close
()
defer
resp
.
Body
.
Close
()
if
resp
.
StatusCode
!=
200
{
if
resp
.
StatusCode
!=
http
.
StatusOK
{
return
nil
,
fmt
.
Errorf
(
"Non-200 response trying to scrape metrics from master: %v"
,
resp
)
return
nil
,
fmt
.
Errorf
(
"Non-200 response trying to scrape metrics from master: %v"
,
resp
)
}
}
...
...
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