Skip to content

Commit 7ef21aa

Browse files
committed
Add test for protocol
Signed-off-by: Stefan Büringer buringerst@vmware.com
1 parent 2e0181a commit 7ef21aa

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pkg/crd/testdata/cronjob_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,13 @@ type CronJobSpec struct {
342342
// +kubebuilder:validation:items:XIntOrString
343343
// +kubebuilder:validation:items:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$"
344344
IntOrStringArrayWithAPattern []*intstr.IntOrString `json:"intOrStringArrayWithAPattern,omitempty"`
345+
346+
// This tests that we can embed protocol correctly (without ending up with allOf).
347+
// Context: https://github.com/kubernetes-sigs/controller-tools/issues/1027
348+
// Defaults to "TCP".
349+
// +optional
350+
// +default="TCP"
351+
Protocol corev1.Protocol `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"`
345352
}
346353

347354
type ContainsNestedMap struct {

pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8949,6 +8949,13 @@ spec:
89498949
description: This tests that pattern validator is properly applied.
89508950
pattern: ^$|^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$
89518951
type: string
8952+
protocol:
8953+
default: TCP
8954+
description: |-
8955+
This tests that we can embed protocol correctly (without ending up with allOf).
8956+
Context: https://github.com/kubernetes-sigs/controller-tools/issues/1027
8957+
Defaults to "TCP".
8958+
type: string
89528959
ptrData:
89538960
additionalProperties:
89548961
type: string

0 commit comments

Comments
 (0)