Skip to content

Commit

Permalink
Add test for protocol
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Büringer [email protected]
  • Loading branch information
sbueringer committed Aug 14, 2024
1 parent 2e0181a commit 7ef21aa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/crd/testdata/cronjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,13 @@ type CronJobSpec struct {
// +kubebuilder:validation:items:XIntOrString
// +kubebuilder:validation:items:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$"
IntOrStringArrayWithAPattern []*intstr.IntOrString `json:"intOrStringArrayWithAPattern,omitempty"`

// This tests that we can embed protocol correctly (without ending up with allOf).
// Context: https://github.com/kubernetes-sigs/controller-tools/issues/1027
// Defaults to "TCP".
// +optional
// +default="TCP"
Protocol corev1.Protocol `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"`
}

type ContainsNestedMap struct {
Expand Down
7 changes: 7 additions & 0 deletions pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8949,6 +8949,13 @@ spec:
description: This tests that pattern validator is properly applied.
pattern: ^$|^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$
type: string
protocol:
default: TCP
description: |-
This tests that we can embed protocol correctly (without ending up with allOf).
Context: https://github.com/kubernetes-sigs/controller-tools/issues/1027
Defaults to "TCP".
type: string
ptrData:
additionalProperties:
type: string
Expand Down

0 comments on commit 7ef21aa

Please sign in to comment.