Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
thbkrkr committed Feb 29, 2024
1 parent 0709342 commit 6eb9ab5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
9 changes: 8 additions & 1 deletion test/api/v1/guestbook_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,15 @@ type GuestbookEntry struct {
// Time of entry
Time metav1.Time `json:"time,omitempty"`
// Comment by guest. This can be a multi-line comment.
// Like this one.
// Now let's test a list:
// * a
// * b
//
// Another isolated comment.
//
// Looks good?
//
// Just like this one.
// +kubebuilder:validation:Pattern=`0*[a-z0-9]*[a-z]*[0-9]*`
Comment string `json:"comment,omitempty"`
// Rating provided by the guest
Expand Down
26 changes: 15 additions & 11 deletions test/expected.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,23 @@ GuestbookEntry defines an entry in a guest book.
[cols="20a,50a,15a,15a", options="header"]
|===
| Field | Description | Default | Validation
| *`name`* __string__ | Name of the guest (pipe \| should be escaped) | | MaxLength: 80 +
| *`name`* __string__ | Name of the guest (pipe \| should be escaped) + | | MaxLength: 80 +
Pattern: `0\*[a-z0-9]*[a-z]*[0-9]` +

| *`time`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#time-v1-meta[$$Time$$]__ | Time of entry | |
| *`time`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#time-v1-meta[$$Time$$]__ | Time of entry + | |
| *`comment`* __string__ | Comment by guest. This can be a multi-line comment. +
Like this one. +
Now let's test a list: +
* a +
* b +

+

+
Another isolated comment. +

Just like this one. | | Pattern: `0\*[a-z0-9]*[a-z]\*[0-9]*` +

| *`rating`* __xref:{anchor_prefix}-github-com-elastic-crd-ref-docs-api-v1-rating[$$Rating$$]__ | Rating provided by the guest | | Maximum: 5 +
Looks good? + | | Pattern: `0\*[a-z0-9]*[a-z]\*[0-9]*` +

| *`rating`* __xref:{anchor_prefix}-github-com-elastic-crd-ref-docs-api-v1-rating[$$Rating$$]__ | Rating provided by the guest + | | Maximum: 5 +
Minimum: 1 +

|===
Expand Down Expand Up @@ -188,14 +192,14 @@ GuestbookSpec defines the desired state of Guestbook.
[cols="20a,50a,15a,15a", options="header"]
|===
| Field | Description | Default | Validation
| *`page`* __xref:{anchor_prefix}-github-com-elastic-crd-ref-docs-api-v1-positiveint[$$PositiveInt$$]__ | Page indicates the page number | 1 | Minimum: 1 +
| *`page`* __xref:{anchor_prefix}-github-com-elastic-crd-ref-docs-api-v1-positiveint[$$PositiveInt$$]__ | Page indicates the page number + | 1 | Minimum: 1 +

| *`entries`* __xref:{anchor_prefix}-github-com-elastic-crd-ref-docs-api-v1-guestbookentry[$$GuestbookEntry$$] array__ | Entries contain guest book entries for the page | |
| *`selector`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#labelselector-v1-meta[$$LabelSelector$$]__ | Selector selects something | |
| *`headers`* __xref:{anchor_prefix}-github-com-elastic-crd-ref-docs-api-v1-guestbookheader[$$GuestbookHeader$$] array__ | Headers contains a list of header items to include in the page | | MaxItems: 10 +
| *`entries`* __xref:{anchor_prefix}-github-com-elastic-crd-ref-docs-api-v1-guestbookentry[$$GuestbookEntry$$] array__ | Entries contain guest book entries for the page + | |
| *`selector`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#labelselector-v1-meta[$$LabelSelector$$]__ | Selector selects something + | |
| *`headers`* __xref:{anchor_prefix}-github-com-elastic-crd-ref-docs-api-v1-guestbookheader[$$GuestbookHeader$$] array__ | Headers contains a list of header items to include in the page + | | MaxItems: 10 +
UniqueItems: true +

| *`certificateRef`* __link:https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.SecretObjectReference[$$SecretObjectReference$$]__ | CertificateRef is a reference to a secret containing a certificate | |
| *`certificateRef`* __link:https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.SecretObjectReference[$$SecretObjectReference$$]__ | CertificateRef is a reference to a secret containing a certificate + | |
|===


Expand Down
2 changes: 1 addition & 1 deletion test/expected.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ _Appears in:_
| --- | --- | --- | --- |
| `name` _string_ | Name of the guest (pipe \| should be escaped) | | MaxLength: 80 <br />Pattern: `0*[a-z0-9]*[a-z]*[0-9]` <br /> |
| `time` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#time-v1-meta)_ | Time of entry | | |
| `comment` _string_ | Comment by guest. This can be a multi-line comment.<br /><br /><br /><br /><br /><br />Just like this one. | | Pattern: `0*[a-z0-9]*[a-z]*[0-9]*` <br /> |
| `comment` _string_ | Comment by guest. This can be a multi-line comment.<br /><br />Like this one.<br /><br />Now let's test a list:<br /><br />* a<br /><br />* b<br /><br /><br /><br /><br /><br />Another isolated comment.<br /><br /><br /><br /><br /><br />Looks good? | | Pattern: `0*[a-z0-9]*[a-z]*[0-9]*` <br /> |
| `rating` _[Rating](#rating)_ | Rating provided by the guest | | Maximum: 5 <br />Minimum: 1 <br /> |


Expand Down

0 comments on commit 6eb9ab5

Please sign in to comment.