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
2b5b04d0
Commit
2b5b04d0
authored
Feb 03, 2017
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update negotiation to reflect current kubectl state
parent
2bb1e758
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
helper.go
staging/src/k8s.io/client-go/discovery/helper.go
+2
-2
helper_blackbox_test.go
...ng/src/k8s.io/client-go/discovery/helper_blackbox_test.go
+3
-3
No files found.
staging/src/k8s.io/client-go/discovery/helper.go
View file @
2b5b04d0
...
...
@@ -104,8 +104,8 @@ func NegotiateVersion(client DiscoveryInterface, requiredGV *schema.GroupVersion
return
&
clientRegisteredGVs
[
0
],
nil
}
return
nil
,
fmt
.
Errorf
(
"failed to negotiate an api version; server supports: %v, client supports: %v"
,
serverVersions
,
clientVersions
)
// fall back to an empty GroupVersion. Most client commands no longer respect a GroupVersion anyway
return
&
schema
.
GroupVersion
{},
nil
}
// GroupVersionResources converts APIResourceLists to the GroupVersionResources.
...
...
staging/src/k8s.io/client-go/discovery/helper_blackbox_test.go
View file @
2b5b04d0
...
...
@@ -118,9 +118,9 @@ func TestNegotiateVersion(t *testing.T) {
statusCode
:
http
.
StatusNotFound
,
},
{
name
:
"discovery fails due to 403 Forbidden errors and thus serverVersions is empty, no fallback
GroupVersion"
,
expect
Err
:
func
(
err
error
)
bool
{
return
strings
.
Contains
(
err
.
Error
(),
"failed to negotiate an api version;"
)
},
statusCode
:
http
.
StatusForbidden
,
name
:
"discovery fails due to 403 Forbidden errors and thus serverVersions is empty, fallback to empty
GroupVersion"
,
expect
edVersion
:
&
schema
.
GroupVersion
{
},
statusCode
:
http
.
StatusForbidden
,
},
}
...
...
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