Skip to content

Commit

Permalink
tests: Add test case showing regression on #141
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed May 20, 2024
1 parent 85686cb commit 560c8a7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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

0 comments on commit 560c8a7

Please sign in to comment.