Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: tests: Add test case showing regression on #141 #952

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkg/crd/testdata/gen/bar.example.com_foos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ spec:
spec:
description: Spec comments SHOULD appear in the CRD spec
properties:
address:
description: This verifies that the format annotation is applied in
the CRD.
format: ipv4
type: string
addresses:
description: This verifies that the format annotation is applied in
the CRD.
format: ipv4
items:
type: string
type: array
defaultedString:
default: fooDefaultString
description: |-
Expand All @@ -46,6 +58,8 @@ spec:
example: fooExampleString
type: string
required:
- address
- addresses
- defaultedString
type: object
status:
Expand Down
8 changes: 8 additions & 0 deletions pkg/crd/testdata/gen/foo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ type FooSpec struct {
// +kubebuilder:default=fooDefaultString
// +kubebuilder:example=fooExampleString
DefaultedString string `json:"defaultedString"`

// This verifies that the format annotation is applied in the CRD.
// +kubebuilder:validation:Format=ipv4
Address string `json:"address"`

// This verifies that the format annotation is applied in the CRD.
// +kubebuilder:validation:Format=ipv4
Addresses []string `json:"addresses"`
}
type FooStatus struct{}

Expand Down
Loading