Skip to content

Commit

Permalink
oneOf types for IntOrString
Browse files Browse the repository at this point in the history
Kubernetes-commit: 809ca47bb1cf4a8ca27499f3b70c0da0b13b6fe5
  • Loading branch information
jiahuif authored and k8s-publishing-bot committed Mar 22, 2022
1 parent 7b6c37e commit 2866f23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/util/intstr/intstr.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ func (IntOrString) OpenAPISchemaType() []string { return []string{"string"} }
// the OpenAPI spec of this type.
func (IntOrString) OpenAPISchemaFormat() string { return "int-or-string" }

// OpenAPIV3OneOfTypes is used by the kube-openapi generator when constructing
// the OpenAPI v3 spec of this type.
func (IntOrString) OpenAPIV3OneOfTypes() []string { return []string{"integer", "string"} }

func ValueOrDefault(intOrPercent *IntOrString, defaultValue IntOrString) *IntOrString {
if intOrPercent == nil {
return &defaultValue
Expand Down

0 comments on commit 2866f23

Please sign in to comment.