Skip to content

Commit 9dd7c4f

Browse files
committed
address review comments - round 1
1 parent 5fd4b33 commit 9dd7c4f

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

content/en/docs/reference/using-api/declarative-validation.md

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -70,30 +70,30 @@ This document provides a comprehensive reference for all available declarative v
7070

7171
| Tag | Description |
7272
| --- | --- |
73-
| [`+k8s:eachKey`](#k8seachkey) | Declares a validation for each key in a map. |
74-
| [`+k8s:eachVal`](#k8seachval) | Declares a validation for each value in a map or list. |
75-
| [`+k8s:enum`](#k8senum) | Indicates that a string type is an enum. |
76-
| [`+k8s:forbidden`](#k8sforbidden) | Indicates that a field may not be specified. |
77-
| [`+k8s:format`](#k8sformat) | Indicates that a string field has a particular format. |
78-
| [`+k8s:ifDisabled`](#k8sifdisabled) | Declares a validation that only applies when an option is disabled. |
79-
| [`+k8s:ifEnabled`](#k8sifenabled) | Declares a validation that only applies when an option is enabled. |
80-
| [`+k8s:immutable`](#k8simmutable) | Indicates that a field may not be updated. |
81-
| [`+k8s:isSubresource`](#k8sissubresource) | Specifies that validations in a package only apply to a specific subresource. |
82-
| [`+k8s:item`](#k8sitem) | Declares a validation for an item of a slice declared as a `+k8s:listType=map`. |
83-
| [`+k8s:listMapKey`](#k8slistmapkey) | Declares a named sub-field of a list's value-type to be part of the list-map key. |
84-
| [`+k8s:listType`](#k8slisttype) | Declares a list field's semantic type. |
85-
| [`+k8s:maxItems`](#k8smaxitems) | Indicates that a list field has a limit on its size. |
86-
| [`+k8s:maxLength`](#k8smaxlength) | Indicates that a string field has a limit on its length. |
87-
| [`+k8s:minimum`](#k8sminimum) | Indicates that a numeric field has a minimum value. |
88-
| [`+k8s:neq`](#k8sneq) | Verifies the field's value is not equal to a specific disallowed value. |
89-
| [`+k8s:opaqueType`](#k8sopaquetype) | Indicates that any validations declared on the referenced type will be ignored. |
90-
| [`+k8s:optional`](#k8soptional) | Indicates that a field is optional to clients. |
91-
| [`+k8s:required`](#k8srequired) | Indicates that a field must be specified by clients. |
92-
| [`+k8s:subfield`](#k8ssubfield) | Declares a validation for a subfield of a struct. |
93-
| [`+k8s:supportsSubresource`](#k8ssupportssubresource) | Declares a supported subresource for the types within a package. |
94-
| [`+k8s:unionDiscriminator`](#k8suniondiscriminator) | Indicates that this field is the discriminator for a union. |
95-
| [`+k8s:unionMember`](#k8sunionmember) | Indicates that this field is a member of a union. |
96-
| [`+k8s:zeroOrOneOfMember`](#k8szerooroneofmember) | Indicates that this field is a member of a zero-or-one-of union. |
73+
| [`+k8s:eachKey`](#tag-eachKey) | Declares a validation for each key in a map. |
74+
| [`+k8s:eachVal`](#tag-eachVal) | Declares a validation for each value in a map or list. |
75+
| [`+k8s:enum`](#tag-enum) | Indicates that a string type is an enum. |
76+
| [`+k8s:forbidden`](#tag-forbidden) | Indicates that a field may not be specified. |
77+
| [`+k8s:format`](#tag-format) | Indicates that a string field has a particular format. |
78+
| [`+k8s:ifDisabled`](#tag-ifDisabled) | Declares a validation that only applies when an option is disabled. |
79+
| [`+k8s:ifEnabled`](#tag-ifEnabled) | Declares a validation that only applies when an option is enabled. |
80+
| [`+k8s:immutable`](#tag-immutable) | Indicates that a field may not be updated. |
81+
| [`+k8s:isSubresource`](#tag-isSubresource) | Specifies that validations in a package only apply to a specific subresource. |
82+
| [`+k8s:item`](#tag-item) | Declares a validation for an item of a slice declared as a `+k8s:listType=map`. |
83+
| [`+k8s:listMapKey`](#tag-listMapKey) | Declares a named sub-field of a list's value-type to be part of the list-map key. |
84+
| [`+k8s:listType`](#tag-listType) | Declares a list field's semantic type. |
85+
| [`+k8s:maxItems`](#tag-maxItems) | Indicates that a list field has a limit on its size. |
86+
| [`+k8s:maxLength`](#tag-maxLength) | Indicates that a string field has a limit on its length. |
87+
| [`+k8s:minimum`](#tag-minimum) | Indicates that a numeric field has a minimum value. |
88+
| [`+k8s:neq`](#tag-neq) | Verifies the field's value is not equal to a specific disallowed value. |
89+
| [`+k8s:opaqueType`](#tag-opaqueType) | Indicates that any validations declared on the referenced type will be ignored. |
90+
| [`+k8s:optional`](#tag-optional) | Indicates that a field is optional to clients. |
91+
| [`+k8s:required`](#tag-required) | Indicates that a field must be specified by clients. |
92+
| [`+k8s:subfield`](#tag-subfield) | Declares a validation for a subfield of a struct. |
93+
| [`+k8s:supportsSubresource`](#tag-supportsSubresource) | Declares a supported subresource for the types within a package. |
94+
| [`+k8s:unionDiscriminator`](#tag-unionDiscriminator) | Indicates that this field is the discriminator for a union. |
95+
| [`+k8s:unionMember`](#tag-unionMember) | Indicates that this field is a member of a union group. |
96+
| [`+k8s:zeroOrOneOfMember`](#tag-zeroOrOneOfMember) | Indicates that this field is a member of a zero-or-one-of group. |
9797

9898
---
9999

@@ -120,7 +120,7 @@ type MyObject struct {
120120

121121
In this example, `eachKey` is used to specify that the `+k8s:minimum` tag should be applied to each `int` key in `MyMap`. This means that all keys in the map must be >= 1.
122122

123-
### `+k8s:eachVal`
123+
### `+k8s:eachVal` {#tag-eachVal}
124124

125125
**Description:**
126126

@@ -141,7 +141,7 @@ type MyObject struct {
141141

142142
In this example, `eachVal` is used to specify that the `+k8s:minimum` tag should be applied to each element in `MyList`. This means that all fields in `MyStruct` must be >= 1.
143143

144-
### `+k8s:enum`
144+
### `+k8s:enum` {#tag-enum}
145145

146146
**Description:**
147147

@@ -171,7 +171,7 @@ type MyObject struct {
171171

172172
The validation logic will ensure that `MyField` is one of the defined enum values (`"A"` or `"B"`).
173173

174-
### `+k8s:forbidden`
174+
### `+k8s:forbidden` {#tag-forbidden}
175175

176176
**Description:**
177177

@@ -188,7 +188,7 @@ type MyObject struct {
188188

189189
In this example, `MyField` cannot be provided (it is forbidden) when creating or updating `MyObject`.
190190

191-
### `+k8s:format`
191+
### `+k8s:format` {#tag-format}
192192

193193
**Description:**
194194

@@ -220,7 +220,7 @@ In this example:
220220
* `Subdomain` must be a valid DNS subdomain.
221221
* `Label` must be a valid DNS label.
222222

223-
### `+k8s:ifDisabled`
223+
### `+k8s:ifDisabled` {#tag-ifDisabled}
224224

225225
**Description:**
226226

@@ -245,7 +245,7 @@ type MyObject struct {
245245

246246
In this example, `MyField` is required only if the "my-feature" option is disabled.
247247

248-
### `+k8s:ifEnabled`
248+
### `+k8s:ifEnabled` {#tag-ifEnabled}
249249

250250
**Description:**
251251

@@ -270,7 +270,7 @@ type MyObject struct {
270270

271271
In this example, `MyField` is required only if the "my-feature" option is enabled.
272272

273-
### `+k8s:isSubresource`
273+
### `+k8s:isSubresource` {#tag-isSubresource}
274274

275275
**Description:**
276276

@@ -310,7 +310,7 @@ type T1 struct {
310310
}
311311
```
312312

313-
### `+k8s:item`
313+
### `+k8s:item` {#tag-item}
314314

315315
**Description:**
316316

@@ -348,7 +348,7 @@ In this example:
348348
* The item with `name` "http" and `port` 80 is immutable.
349349
* The item with `name` "https" and `port` 443 is required.
350350

351-
### `+k8s:listMapKey`
351+
### `+k8s:listMapKey` {#tag-listMapKey}
352352

353353
**Description:**
354354

@@ -375,7 +375,7 @@ type MyStruct struct {
375375

376376
In this example, `listMapKey` is used to specify that the `keyField` of `MyStruct` should be used as the key for the list-map.
377377

378-
### `+k8s:listType`
378+
### `+k8s:listType` {#tag-listType}
379379

380380
**Description:**
381381

@@ -402,7 +402,7 @@ type MyStruct struct {
402402

403403
In this example, `MyList` is declared as a list of type `map`, with `keyField` as the key. This means that the validation logic will ensure that each element in the list has a unique `keyField`.
404404

405-
### `+k8s:maxItems`
405+
### `+k8s:maxItems` {#tag-maxItems}
406406

407407
**Description:**
408408

@@ -423,7 +423,7 @@ type MyObject struct {
423423

424424
In this example, `MyList` cannot contain more than 5 items.
425425

426-
### `+k8s:maxLength`
426+
### `+k8s:maxLength` {#tag-maxLength}
427427

428428
**Description:**
429429

@@ -444,7 +444,7 @@ type MyObject struct {
444444

445445
In this example, `MyString` cannot be longer than 10 characters.
446446

447-
### `+k8s:minimum`
447+
### `+k8s:minimum` {#tag-minimum}
448448

449449
**Description:**
450450

@@ -465,7 +465,7 @@ type MyObject struct {
465465

466466
In this example, `MyInt` must be greater than or equal to 0.
467467

468-
### `+k8s:neq`
468+
### `+k8s:neq` {#tag-neq}
469469

470470
**Description:**
471471

@@ -495,7 +495,7 @@ In this example:
495495
* `MyInt` cannot be equal to `0`.
496496
* `MyBool` cannot be equal to `true`.
497497

498-
### `+k8s:opaqueType`
498+
### `+k8s:opaqueType` {#tag-opaqueType}
499499

500500
**Description:**
501501

@@ -514,7 +514,7 @@ type MyObject struct {
514514

515515
In this example, any validation tags on `package.ExternalType` will be ignored.
516516

517-
### `+k8s:optional`
517+
### `+k8s:optional` {#tag-optional}
518518

519519
**Description:**
520520

@@ -531,7 +531,7 @@ type MyObject struct {
531531

532532
In this example, `MyField` is not required to be provided when creating or updating `MyObject`.
533533

534-
### `+k8s:required`
534+
### `+k8s:required` {#tag-required}
535535

536536
**Description:**
537537

@@ -548,7 +548,7 @@ type MyObject struct {
548548

549549
In this example, `MyField` must be provided when creating or updating `MyObject`.
550550

551-
### `+k8s:subfield`
551+
### `+k8s:subfield` {#tag-subfield}
552552

553553
**Description:**
554554

@@ -577,7 +577,7 @@ type MyStruct struct {
577577

578578
In this example, `MySubfield` within `MyStruct` is required.
579579

580-
### `+k8s:supportsSubresource`
580+
### `+k8s:supportsSubresource` {#tag-supportsSubresource}
581581

582582
**Description:**
583583

@@ -603,7 +603,7 @@ package v1
603603

604604
In this example, the package `v1` declares that the `/status` and `/scale` subresources are supported, allowing validation rules to be specifically targeted to them.
605605

606-
### `+k8s:unionDiscriminator`
606+
### `+k8s:unionDiscriminator` {#tag-unionDiscriminator}
607607

608608
**Description:**
609609

@@ -630,7 +630,7 @@ type MyObject struct {
630630

631631
In this example, the `Type` field is the discriminator for the union. The value of `Type` will determine which of the union members (`A` or `B`) is expected to be present.
632632

633-
### `+k8s:unionMember`
633+
### `+k8s:unionMember` {#tag-unionMember}
634634

635635
**Description:**
636636

@@ -658,7 +658,7 @@ type MyObject struct {
658658

659659
In this example, `A` and `B` are members of the union. If the `Type` field has the value `"a"`, then the `a` field is expected to be present. If the `Type` field has the value `"b-member"`, then the `b` field is expected to be present.
660660

661-
### `+k8s:zeroOrOneOfMember`
661+
### `+k8s:zeroOrOneOfMember` {#tag-zeroOrOneOfMember}
662662

663663
**Description:**
664664

@@ -681,4 +681,4 @@ type MyObject struct {
681681
}
682682
```
683683

684-
In this example, at most one of `A` or `B` can be set. It is also valid for neither to be set.
684+
In this example, at most one of `A` or `B` can be set. It is also valid for neither to be set.

0 commit comments

Comments
 (0)