Skip to content

Commit 9f4e030

Browse files
committed
Document marker syntax for maps
1 parent 1692c5a commit 9f4e030

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docs/book/src/reference/markers.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ In general, markers may either be:
5353
comma-separated. Order of arguments doesn't matter. Some arguments may
5454
be optional.
5555

56-
Marker arguments may be strings, ints, bools, or slices thereof. Strings,
57-
ints, and bools follow their Go syntax:
56+
Marker arguments may be strings, ints, bools, slices, or maps thereof.
57+
Strings, ints, and bools follow their Go syntax:
5858

5959
```go
6060
// +kubebuilder:validation:ExclusiveMaximum=false
@@ -82,3 +82,12 @@ or, in simple cases, by separating with semicolons:
8282
```go
8383
// +kubebuilder:validation:Enum=Wallace;Gromit;Chicken
8484
```
85+
86+
Maps are specified with string keys and values of any type (effectively
87+
`map[string]interface{}`). A map is surrounded by curly braces (`{}`),
88+
each key and value is separated by a colon (`:`), and each key-value
89+
pair is separated by a comma:
90+
91+
```go
92+
// +kubebuilder:validation:Default={magic: {numero: 42, stringified: forty-two}}
93+
```

0 commit comments

Comments
 (0)