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
102bc901
Unverified
Commit
102bc901
authored
Jun 19, 2018
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bump(k8s.io/kube-openapi): 91cfa479c814065e420cee7ed227db0f63a5854e
parent
debc5387
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
66 additions
and
51 deletions
+66
-51
Godeps.json
Godeps/Godeps.json
+9
-9
Godeps.json
...ing/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json
+5
-5
Godeps.json
staging/src/k8s.io/apimachinery/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/apiserver/Godeps/Godeps.json
+5
-5
Godeps.json
staging/src/k8s.io/client-go/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/code-generator/Godeps/Godeps.json
+2
-2
Godeps.json
staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json
+6
-6
Godeps.json
staging/src/k8s.io/metrics/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json
+5
-5
Godeps.json
staging/src/k8s.io/sample-controller/Godeps/Godeps.json
+1
-1
openapi.go
vendor/k8s.io/kube-openapi/pkg/builder/openapi.go
+27
-13
openapi.go
vendor/k8s.io/kube-openapi/pkg/generators/openapi.go
+3
-2
No files found.
Godeps/Godeps.json
View file @
102bc901
...
...
@@ -3357,39 +3357,39 @@
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/aggregator"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/builder"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/common"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/generators"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/handler"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto/testing"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto/validation"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/utils/clock"
,
...
...
staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json
View file @
102bc901
...
...
@@ -2036,23 +2036,23 @@
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/builder"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/common"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/handler"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/apimachinery/pkg/api/equality"
,
...
...
staging/src/k8s.io/apimachinery/Godeps/Godeps.json
View file @
102bc901
...
...
@@ -180,7 +180,7 @@
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
}
]
}
staging/src/k8s.io/apiserver/Godeps/Godeps.json
View file @
102bc901
...
...
@@ -1764,23 +1764,23 @@
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/builder"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/common"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/handler"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/client-go/discovery"
,
...
...
staging/src/k8s.io/client-go/Godeps/Godeps.json
View file @
102bc901
...
...
@@ -588,7 +588,7 @@
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
}
]
}
staging/src/k8s.io/code-generator/Godeps/Godeps.json
View file @
102bc901
...
...
@@ -260,11 +260,11 @@
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/common"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/generators"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
}
]
}
staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json
View file @
102bc901
...
...
@@ -1684,27 +1684,27 @@
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/aggregator"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/builder"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/common"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/handler"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
}
]
}
staging/src/k8s.io/metrics/Godeps/Godeps.json
View file @
102bc901
...
...
@@ -492,7 +492,7 @@
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
}
]
}
staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json
View file @
102bc901
...
...
@@ -1648,23 +1648,23 @@
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/builder"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/common"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/handler"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
}
]
}
staging/src/k8s.io/sample-controller/Godeps/Godeps.json
View file @
102bc901
...
...
@@ -1076,7 +1076,7 @@
},
{
"ImportPath"
:
"k8s.io/kube-openapi/pkg/util/proto"
,
"Rev"
:
"
8a9b82f00b3a86eac24681da3f9fe6c34c01cea2
"
"Rev"
:
"
91cfa479c814065e420cee7ed227db0f63a5854e
"
}
]
}
vendor/k8s.io/kube-openapi/pkg/builder/openapi.go
View file @
102bc901
...
...
@@ -58,7 +58,7 @@ func BuildOpenAPIDefinitionsForResource(model interface{}, config *common.Config
o
:=
newOpenAPI
(
config
)
// We can discard the return value of toSchema because all we care about is the side effect of calling it.
// All the models created for this resource get added to o.swagger.Definitions
_
,
err
:=
o
.
toSchema
(
model
)
_
,
err
:=
o
.
toSchema
(
getCanonicalTypeName
(
model
)
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -69,6 +69,21 @@ func BuildOpenAPIDefinitionsForResource(model interface{}, config *common.Config
return
&
swagger
.
Definitions
,
nil
}
// BuildOpenAPIDefinitionsForResources returns the OpenAPI spec which includes the definitions for the
// passed type names.
func
BuildOpenAPIDefinitionsForResources
(
config
*
common
.
Config
,
names
...
string
)
(
*
spec
.
Swagger
,
error
)
{
o
:=
newOpenAPI
(
config
)
// We can discard the return value of toSchema because all we care about is the side effect of calling it.
// All the models created for this resource get added to o.swagger.Definitions
for
_
,
name
:=
range
names
{
_
,
err
:=
o
.
toSchema
(
name
)
if
err
!=
nil
{
return
nil
,
err
}
}
return
o
.
finalizeSwagger
()
}
// newOpenAPI sets up the openAPI object so we can build the spec.
func
newOpenAPI
(
config
*
common
.
Config
)
openAPI
{
o
:=
openAPI
{
...
...
@@ -120,7 +135,11 @@ func (o *openAPI) finalizeSwagger() (*spec.Swagger, error) {
return
o
.
swagger
,
nil
}
func
getCanonicalizeTypeName
(
t
reflect
.
Type
)
string
{
func
getCanonicalTypeName
(
model
interface
{})
string
{
t
:=
reflect
.
TypeOf
(
model
)
if
t
.
Kind
()
==
reflect
.
Ptr
{
t
=
t
.
Elem
()
}
if
t
.
PkgPath
()
==
""
{
return
t
.
Name
()
}
...
...
@@ -165,12 +184,7 @@ func (o *openAPI) buildDefinitionRecursively(name string) error {
// buildDefinitionForType build a definition for a given type and return a referable name to its definition.
// This is the main function that keep track of definitions used in this spec and is depend on code generated
// by k8s.io/kubernetes/cmd/libs/go2idl/openapi-gen.
func
(
o
*
openAPI
)
buildDefinitionForType
(
sample
interface
{})
(
string
,
error
)
{
t
:=
reflect
.
TypeOf
(
sample
)
if
t
.
Kind
()
==
reflect
.
Ptr
{
t
=
t
.
Elem
()
}
name
:=
getCanonicalizeTypeName
(
t
)
func
(
o
*
openAPI
)
buildDefinitionForType
(
name
string
)
(
string
,
error
)
{
if
err
:=
o
.
buildDefinitionRecursively
(
name
);
err
!=
nil
{
return
""
,
err
}
...
...
@@ -321,7 +335,7 @@ func (o *openAPI) buildOperations(route restful.Route, inPathCommonParamsMap map
}
func
(
o
*
openAPI
)
buildResponse
(
model
interface
{},
description
string
)
(
spec
.
Response
,
error
)
{
schema
,
err
:=
o
.
toSchema
(
model
)
schema
,
err
:=
o
.
toSchema
(
getCanonicalTypeName
(
model
)
)
if
err
!=
nil
{
return
spec
.
Response
{},
err
}
...
...
@@ -366,8 +380,8 @@ func (o *openAPI) findCommonParameters(routes []restful.Route) (map[interface{}]
return
commonParamsMap
,
nil
}
func
(
o
*
openAPI
)
toSchema
(
model
interface
{}
)
(
_
*
spec
.
Schema
,
err
error
)
{
if
openAPIType
,
openAPIFormat
:=
common
.
GetOpenAPITypeFormat
(
getCanonicalizeTypeName
(
reflect
.
TypeOf
(
model
))
);
openAPIType
!=
""
{
func
(
o
*
openAPI
)
toSchema
(
name
string
)
(
_
*
spec
.
Schema
,
err
error
)
{
if
openAPIType
,
openAPIFormat
:=
common
.
GetOpenAPITypeFormat
(
name
);
openAPIType
!=
""
{
return
&
spec
.
Schema
{
SchemaProps
:
spec
.
SchemaProps
{
Type
:
[]
string
{
openAPIType
},
...
...
@@ -375,7 +389,7 @@ func (o *openAPI) toSchema(model interface{}) (_ *spec.Schema, err error) {
},
},
nil
}
else
{
ref
,
err
:=
o
.
buildDefinitionForType
(
model
)
ref
,
err
:=
o
.
buildDefinitionForType
(
name
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -399,7 +413,7 @@ func (o *openAPI) buildParameter(restParam restful.ParameterData, bodySample int
case
restful
.
BodyParameterKind
:
if
bodySample
!=
nil
{
ret
.
In
=
"body"
ret
.
Schema
,
err
=
o
.
toSchema
(
bodySample
)
ret
.
Schema
,
err
=
o
.
toSchema
(
getCanonicalTypeName
(
bodySample
)
)
return
ret
,
err
}
else
{
// There is not enough information in the body parameter to build the definition.
...
...
vendor/k8s.io/kube-openapi/pkg/generators/openapi.go
View file @
102bc901
...
...
@@ -383,8 +383,9 @@ func (g openAPITypeWriter) generate(t *types.Type) error {
if
hasOpenAPIDefinitionMethods
(
t
)
{
g
.
Do
(
"return $.OpenAPIDefinition|raw${
\n
"
+
"Schema: spec.Schema{
\n
"
+
"SchemaProps: spec.SchemaProps{
\n
"
+
"Type:$.type|raw${}.OpenAPISchemaType(),
\n
"
+
"SchemaProps: spec.SchemaProps{
\n
"
,
args
)
g
.
generateDescription
(
t
.
CommentLines
)
g
.
Do
(
"Type:$.type|raw${}.OpenAPISchemaType(),
\n
"
+
"Format:$.type|raw${}.OpenAPISchemaFormat(),
\n
"
+
"},
\n
"
+
"},
\n
"
+
...
...
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