Skip to content

Commit 03fc8ba

Browse files
committed
Selectable field marker parser test
1 parent e079927 commit 03fc8ba

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pkg/crd/testdata/cronjob_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ type CronJobSpec struct {
349349
// +optional
350350
// +default="TCP"
351351
Protocol corev1.Protocol `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"`
352+
353+
// This tests that selectable field.
354+
SelectableFieldString string `json:"selectableFieldString,omitempty"`
352355
}
353356

354357
type ContainsNestedMap struct {
@@ -634,6 +637,7 @@ type CronJobStatus struct {
634637
// +kubebuilder:resource:singular=mycronjob
635638
// +kubebuilder:storageversion
636639
// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes-sigs/controller-tools";"cert-manager.io/inject-ca-from-secret=cert-manager/cert-manager-webhook-ca"
640+
// +kubebuilder:selectablefield:JSONPath=`.spec.selectableFieldString`
637641

638642
// CronJob is the Schema for the cronjobs API
639643
type CronJob struct {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8966,6 +8966,9 @@ spec:
89668966
type: string
89678967
schemaless:
89688968
description: This tests that the schemaless marker works
8969+
selectableFieldString:
8970+
description: This tests that selectable field.
8971+
type: string
89698972
startingDeadlineSeconds:
89708973
description: |-
89718974
Optional deadline in seconds for starting the job if it misses scheduled
@@ -9203,6 +9206,8 @@ spec:
92039206
type: string
92049207
type: object
92059208
type: object
9209+
selectableFields:
9210+
- jsonPath: .spec.selectableFieldString
92069211
served: true
92079212
storage: true
92089213
subresources:

0 commit comments

Comments
 (0)