-
Couldn't load subscription status.
- Fork 458
Closed
Labels
lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.Denotes an issue or PR has remained open with no activity and has become stale.
Description
from kubebuilder 2.0, generated openapi validation spec is changed. i was able to circumvent this problem by manually patch generated CRD in crd/kustomization.yaml, but i think this one needs fix.
foo_types.go
type FooSpec struct {
// +kubebuilder:validation:Enum=foo;bar;baz
Foos []string `json:"foos"`
}
expected CRD
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: foo.com
spec:
validation:
openAPIV3Schema:
properties:
spec:
properties:
foos:
items:
enum:
- foo
- bar
- baz
type: string
type: array
actual CRD
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: foo.com
spec:
validation:
openAPIV3Schema:
properties:
spec:
properties:
foos:
enum:
- foo
- bar
- baz
items:
type: string
type: array
kustomization.yaml patch
patches:
- patch: |-
- op: replace
path: /spec/validation/openAPIV3Schema/properties/spec/properties/foos
value:
items:
enum:
- foo
- bar
- baz
type: string
type: array
target:
kind: CustomResourceDefinition
name: foo.com
Metadata
Metadata
Assignees
Labels
lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.Denotes an issue or PR has remained open with no activity and has become stale.