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
acdc4562
Commit
acdc4562
authored
Sep 27, 2018
by
tanshanshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use http.StatusOK instead of 200
parent
516876b2
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 @
acdc4562
...
...
@@ -19,6 +19,7 @@ package master
import
(
"encoding/json"
"fmt"
"net/http"
"reflect"
"strings"
"testing"
...
...
@@ -98,8 +99,8 @@ func TestOpenAPIDelegationChainPlumbing(t *testing.T) {
result
:=
kubeclient
.
RESTClient
()
.
Get
()
.
AbsPath
(
"/swagger.json"
)
.
Do
()
status
:=
0
result
.
StatusCode
(
&
status
)
if
status
!=
200
{
t
.
Fatalf
(
"GET /swagger.json failed: expected status=%d, got=%d"
,
200
,
status
)
if
status
!=
http
.
StatusOK
{
t
.
Fatalf
(
"GET /swagger.json failed: expected status=%d, got=%d"
,
http
.
StatusOK
,
status
)
}
raw
,
err
:=
result
.
Raw
()
...
...
test/integration/metrics/metrics_test.go
View file @
acdc4562
...
...
@@ -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
)
}
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
)
}
...
...
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