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
f0e11c5b
Unverified
Commit
f0e11c5b
authored
Jul 16, 2017
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove "special" restclient parameters
parent
b6d9815b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
+3
-10
request.go
staging/src/k8s.io/client-go/rest/request.go
+1
-9
request_test.go
staging/src/k8s.io/client-go/rest/request_test.go
+2
-1
No files found.
staging/src/k8s.io/client-go/rest/request.go
View file @
f0e11c5b
...
@@ -50,10 +50,6 @@ import (
...
@@ -50,10 +50,6 @@ import (
)
)
var
(
var
(
// specialParams lists parameters that are handled specially and which users of Request
// are therefore not allowed to set manually.
specialParams
=
sets
.
NewString
(
"timeout"
)
// longThrottleLatency defines threshold for logging requests. All requests being
// longThrottleLatency defines threshold for logging requests. All requests being
// throttle for more than longThrottleLatency will be logged.
// throttle for more than longThrottleLatency will be logged.
longThrottleLatency
=
50
*
time
.
Millisecond
longThrottleLatency
=
50
*
time
.
Millisecond
...
@@ -269,7 +265,7 @@ func (r *Request) AbsPath(segments ...string) *Request {
...
@@ -269,7 +265,7 @@ func (r *Request) AbsPath(segments ...string) *Request {
}
}
// RequestURI overwrites existing path and parameters with the value of the provided server relative
// RequestURI overwrites existing path and parameters with the value of the provided server relative
// URI.
Some parameters (those in specialParameters) cannot be overwritten.
// URI.
func
(
r
*
Request
)
RequestURI
(
uri
string
)
*
Request
{
func
(
r
*
Request
)
RequestURI
(
uri
string
)
*
Request
{
if
r
.
err
!=
nil
{
if
r
.
err
!=
nil
{
return
r
return
r
...
@@ -491,10 +487,6 @@ func (r *Request) VersionedParams(obj runtime.Object, codec runtime.ParameterCod
...
@@ -491,10 +487,6 @@ func (r *Request) VersionedParams(obj runtime.Object, codec runtime.ParameterCod
}
}
func
(
r
*
Request
)
setParam
(
paramName
,
value
string
)
*
Request
{
func
(
r
*
Request
)
setParam
(
paramName
,
value
string
)
*
Request
{
if
specialParams
.
Has
(
paramName
)
{
r
.
err
=
fmt
.
Errorf
(
"must set %v through the corresponding function, not directly."
,
paramName
)
return
r
}
if
r
.
params
==
nil
{
if
r
.
params
==
nil
{
r
.
params
=
make
(
url
.
Values
)
r
.
params
=
make
(
url
.
Values
)
}
}
...
...
staging/src/k8s.io/client-go/rest/request_test.go
View file @
f0e11c5b
...
@@ -1515,7 +1515,8 @@ func TestUnacceptableParamNames(t *testing.T) {
...
@@ -1515,7 +1515,8 @@ func TestUnacceptableParamNames(t *testing.T) {
testVal
string
testVal
string
expectSuccess
bool
expectSuccess
bool
}{
}{
{
"timeout"
,
"42"
,
false
},
// timeout is no longer "protected"
{
"timeout"
,
"42"
,
true
},
}
}
for
_
,
item
:=
range
table
{
for
_
,
item
:=
range
table
{
...
...
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