Merge pull request #63565 from roycaihw/bump-kube-openapi-dep

Automatic merge from submit-queue (batch tested with PRs 59034, 63565, 63533). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bump kube-openapi dependency

picks: https://github.com/kubernetes/kube-openapi/pull/67
ref: https://github.com/kubernetes/kubernetes/issues/63494

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-05-09 05:13:12 -07:00 committed by GitHub
commit 3663dc757e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 56 additions and 34 deletions

16
Godeps/Godeps.json generated
View File

@ -3299,35 +3299,35 @@
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/aggregator",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/builder",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/common",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/generators",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/handler",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto/validation",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/utils/clock",

View File

@ -1996,23 +1996,23 @@
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/builder",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/common",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/handler",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",

View File

@ -180,7 +180,7 @@
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
}
]
}

View File

@ -1724,23 +1724,23 @@
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/builder",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/common",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/handler",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/client-go/discovery",

View File

@ -568,7 +568,7 @@
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
}
]
}

View File

@ -260,11 +260,11 @@
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/common",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/generators",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
}
]
}

View File

@ -1640,27 +1640,27 @@
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/aggregator",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/builder",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/common",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/handler",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
}
]
}

View File

@ -1604,23 +1604,23 @@
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/builder",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/common",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/handler",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
}
]
}

View File

@ -916,7 +916,7 @@
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
"Rev": "f08db293d3ef80052d6513ece19792642a289fea"
"Rev": "61db125d227fc9d4e373819a059516f32f7f23c7"
}
]
}

View File

@ -61,6 +61,10 @@ func (s *referenceWalker) walkRef(ref spec.Ref) spec.Ref {
k := refStr[len(definitionPrefix):]
def := s.root.Definitions[k]
s.walkSchema(&def)
// Make sure we don't assign to nil map
if s.root.Definitions == nil {
s.root.Definitions = spec.Definitions{}
}
s.root.Definitions[k] = def
}
return s.walkRefCallback(ref)
@ -147,6 +151,9 @@ func (s *referenceWalker) walkOperation(op *spec.Operation) {
}
func (s *referenceWalker) Start() {
if s.root.Paths == nil {
return
}
for _, pathItem := range s.root.Paths.Paths {
s.walkParams(pathItem.Parameters)
s.walkOperation(pathItem.Delete)
@ -220,6 +227,10 @@ func renameDefinition(s *spec.Swagger, old, new string) {
}
return ref
}, s)
// Make sure we don't assign to nil map
if s.Definitions == nil {
s.Definitions = spec.Definitions{}
}
s.Definitions[new] = s.Definitions[old]
delete(s.Definitions, old)
}
@ -244,6 +255,13 @@ func MergeSpecs(dest, source *spec.Swagger) error {
func mergeSpecs(dest, source *spec.Swagger, renameModelConflicts, ignorePathConflicts bool) (err error) {
specCloned := false
// Paths may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering).
if source.Paths == nil {
source.Paths = &spec.Paths{}
}
if dest.Paths == nil {
dest.Paths = &spec.Paths{}
}
if ignorePathConflicts {
keepPaths := []string{}
hasConflictingPath := false
@ -346,6 +364,10 @@ func mergeSpecs(dest, source *spec.Swagger, renameModelConflicts, ignorePathConf
if _, found := dest.Paths.Paths[k]; found {
return fmt.Errorf("unable to merge: duplicated path %s", k)
}
// PathItem may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering).
if dest.Paths.Paths == nil {
dest.Paths.Paths = map[string]spec.PathItem{}
}
dest.Paths.Paths[k] = v
}
return nil