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
01bc4eff
Commit
01bc4eff
authored
Nov 19, 2018
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openapi-aggregation: merge without clones
parent
84f0629e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
aggregator.go
....io/kube-aggregator/pkg/controllers/openapi/aggregator.go
+6
-7
No files found.
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapi/aggregator.go
View file @
01bc4eff
...
@@ -196,13 +196,12 @@ func (s *specAggregator) buildOpenAPISpec() (specToReturn *spec.Swagger, err err
...
@@ -196,13 +196,12 @@ func (s *specAggregator) buildOpenAPISpec() (specToReturn *spec.Swagger, err err
}
}
sortByPriority
(
specs
)
sortByPriority
(
specs
)
for
_
,
specInfo
:=
range
specs
{
for
_
,
specInfo
:=
range
specs
{
// TODO: Make kube-openapi.MergeSpec(s) accept nil or empty spec as destination and just clone the spec in that case.
if
specToReturn
==
nil
{
if
specToReturn
==
nil
{
specToReturn
,
err
=
aggregator
.
CloneSpec
(
specInfo
.
spec
)
specToReturn
=
&
spec
.
Swagger
{}
if
err
!=
nil
{
*
specToReturn
=
*
specInfo
.
spec
return
nil
,
err
// Paths and Definitions are set by MergeSpecsIgnorePathConflict
}
specToReturn
.
Paths
=
nil
continue
specToReturn
.
Definitions
=
nil
}
}
if
err
:=
aggregator
.
MergeSpecsIgnorePathConflict
(
specToReturn
,
specInfo
.
spec
);
err
!=
nil
{
if
err
:=
aggregator
.
MergeSpecsIgnorePathConflict
(
specToReturn
,
specInfo
.
spec
);
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -267,7 +266,7 @@ func (s *specAggregator) UpdateAPIServiceSpec(apiServiceName string, spec *spec.
...
@@ -267,7 +266,7 @@ func (s *specAggregator) UpdateAPIServiceSpec(apiServiceName string, spec *spec.
// For APIServices (non-local) specs, only merge their /apis/ prefixed endpoint as it is the only paths
// For APIServices (non-local) specs, only merge their /apis/ prefixed endpoint as it is the only paths
// proxy handler delegates.
// proxy handler delegates.
if
specInfo
.
apiService
.
Spec
.
Service
!=
nil
{
if
specInfo
.
apiService
.
Spec
.
Service
!=
nil
{
aggregator
.
FilterSpecByPath
s
(
spec
,
[]
string
{
"/apis/"
})
spec
=
aggregator
.
FilterSpecByPathsWithoutSideEffect
s
(
spec
,
[]
string
{
"/apis/"
})
}
}
return
s
.
tryUpdatingServiceSpecs
(
&
openAPISpecInfo
{
return
s
.
tryUpdatingServiceSpecs
(
&
openAPISpecInfo
{
...
...
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