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
aee962c0
Commit
aee962c0
authored
Sep 06, 2016
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make swaggerschema agnostic about which version to use
parent
c9fde2ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
factory.go
pkg/kubectl/cmd/util/factory.go
+9
-3
No files found.
pkg/kubectl/cmd/util/factory.go
View file @
aee962c0
...
@@ -740,12 +740,18 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
...
@@ -740,12 +740,18 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
return
validation
.
NullSchema
{},
nil
return
validation
.
NullSchema
{},
nil
},
},
SwaggerSchema
:
func
(
gvk
unversioned
.
GroupVersionKind
)
(
*
swagger
.
ApiDeclaration
,
error
)
{
SwaggerSchema
:
func
(
gvk
unversioned
.
GroupVersionKind
)
(
*
swagger
.
ApiDeclaration
,
error
)
{
version
:=
gvk
.
GroupVersion
()
// discovery doesn't care about which groupversion you get a client for,
client
,
err
:=
clients
.
ClientForVersion
(
&
version
)
// so get whichever one you happen to have available and use that.
cfg
,
err
:=
clients
.
ClientConfigForVersion
(
nil
)
if
err
!=
nil
{
return
nil
,
err
}
dc
,
err
:=
discovery
.
NewDiscoveryClientForConfig
(
cfg
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
return
client
.
Discovery
()
.
SwaggerSchema
(
version
)
return
dc
.
SwaggerSchema
(
gvk
.
GroupVersion
())
},
},
DefaultNamespace
:
func
()
(
string
,
bool
,
error
)
{
DefaultNamespace
:
func
()
(
string
,
bool
,
error
)
{
return
clientConfig
.
Namespace
()
return
clientConfig
.
Namespace
()
...
...
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