Skip to content

Commit 2866f23

Browse files
jiahuifk8s-publishing-bot
authored andcommitted
oneOf types for IntOrString
Kubernetes-commit: 809ca47bb1cf4a8ca27499f3b70c0da0b13b6fe5
1 parent 7b6c37e commit 2866f23

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: pkg/util/intstr/intstr.go

+4
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ func (IntOrString) OpenAPISchemaType() []string { return []string{"string"} }
131131
// the OpenAPI spec of this type.
132132
func (IntOrString) OpenAPISchemaFormat() string { return "int-or-string" }
133133

134+
// OpenAPIV3OneOfTypes is used by the kube-openapi generator when constructing
135+
// the OpenAPI v3 spec of this type.
136+
func (IntOrString) OpenAPIV3OneOfTypes() []string { return []string{"integer", "string"} }
137+
134138
func ValueOrDefault(intOrPercent *IntOrString, defaultValue IntOrString) *IntOrString {
135139
if intOrPercent == nil {
136140
return &defaultValue

0 commit comments

Comments
 (0)