Bump to latest kube-openapi and SMD to pick up structType=atomic support
This commit is contained in:
5
vendor/k8s.io/kube-openapi/pkg/generators/openapi.go
generated
vendored
5
vendor/k8s.io/kube-openapi/pkg/generators/openapi.go
generated
vendored
@@ -282,6 +282,9 @@ func typeShortName(t *types.Type) string {
|
||||
|
||||
func (g openAPITypeWriter) generateMembers(t *types.Type, required []string) ([]string, error) {
|
||||
var err error
|
||||
for t.Kind == types.Pointer { // fast-forward to effective type containing members
|
||||
t = t.Elem
|
||||
}
|
||||
for _, m := range t.Members {
|
||||
if hasOpenAPITagValue(m.CommentLines, tagValueFalse) {
|
||||
continue
|
||||
@@ -534,7 +537,7 @@ func (g openAPITypeWriter) generateDescription(CommentLines []string) {
|
||||
default:
|
||||
if strings.HasPrefix(line, " ") || strings.HasPrefix(line, "\t") {
|
||||
delPrevChar()
|
||||
line = "\n" + line + "\n" // Replace it with newline. This is useful when we have a line with: "Example:\n\tJSON-someting..."
|
||||
line = "\n" + line + "\n" // Replace it with newline. This is useful when we have a line with: "Example:\n\tJSON-something..."
|
||||
} else {
|
||||
line += " "
|
||||
}
|
||||
|
2
vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go
generated
vendored
2
vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go
generated
vendored
@@ -155,7 +155,7 @@ func namesMatch(goName, jsonName string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// isCaptical returns true if one character is capital
|
||||
// isCapital returns true if one character is capital
|
||||
func isCapital(b byte) bool {
|
||||
return b >= 'A' && b <= 'Z'
|
||||
}
|
||||
|
25
vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go
generated
vendored
25
vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go
generated
vendored
@@ -312,6 +312,18 @@ func (c *convert) VisitKind(k *proto.Kind) {
|
||||
NamedType: &deducedName,
|
||||
}
|
||||
}
|
||||
|
||||
ext := k.GetExtensions()
|
||||
if val, ok := ext["x-kubernetes-map-type"]; ok {
|
||||
switch val {
|
||||
case "atomic":
|
||||
a.Map.ElementRelationship = schema.Atomic
|
||||
case "granular":
|
||||
a.Map.ElementRelationship = schema.Separable
|
||||
default:
|
||||
c.reportError("unknown map type %v", val)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func toStringSlice(o interface{}) (out []string, ok bool) {
|
||||
@@ -384,8 +396,17 @@ func (c *convert) VisitMap(m *proto.Map) {
|
||||
a.Map = &schema.Map{}
|
||||
a.Map.ElementType = c.makeRef(m.SubType, c.preserveUnknownFields)
|
||||
|
||||
// TODO: Get element relationship when we start putting it into the
|
||||
// spec.
|
||||
ext := m.GetExtensions()
|
||||
if val, ok := ext["x-kubernetes-map-type"]; ok {
|
||||
switch val {
|
||||
case "atomic":
|
||||
a.Map.ElementRelationship = schema.Atomic
|
||||
case "granular":
|
||||
a.Map.ElementRelationship = schema.Separable
|
||||
default:
|
||||
c.reportError("unknown map type %v", val)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ptr(s schema.Scalar) *schema.Scalar { return &s }
|
||||
|
Reference in New Issue
Block a user