Skip to content

Commit 58be049

Browse files
author
Daniel Feinberg
committed
adding documentation
1 parent d0169c6 commit 58be049

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

doc/user-guide.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,21 @@ func main() {
6565
}
6666
```
6767

68-
**Note:** The number of concurrent informer workers can be configured with an additional Watch option. The default value is 1 if an argument is not given.
68+
#### Options
69+
**Worker Count**
70+
The number of concurrent informer workers can be configured with an additional Watch option. The default value is 1 if an argument is not given.
6971
```Go
7072
sdk.Watch("cache.example.com/v1alpha1", "Memcached", "default", 5, sdk.WithNumWorkers(n))
7173
```
7274

75+
**Label Selector**
76+
Label selectors allow the watch to filter resources by kubernetes labels. It can be sepecified using the standard kubernetes label selector format:
77+
[https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors]
78+
79+
```Go
80+
sdk.Watch("cache.example.com/v1alpha1", "Memcached", "default", 5, sdk.WithLabelSelector("app=myapp"))
81+
```
82+
7383
### Define the Memcached spec and status
7484

7585
Modify the spec and status of the `Memcached` CR at `pkg/apis/cache/v1alpha1/types.go`:

0 commit comments

Comments
 (0)