Skip to content

Commit 146b46a

Browse files
CSdreadDaniel Feinberg
authored and
Daniel Feinberg
committed
Merge pull request #2 from CSdread/314-label-selector
adding documentation
2 parents cd3dd92 + 58be049 commit 146b46a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

doc/user-guide.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,22 @@ 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 specified using the standard kubernetes label selector format:
77+
78+
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
79+
80+
```Go
81+
sdk.Watch("cache.example.com/v1alpha1", "Memcached", "default", 5, sdk.WithLabelSelector("app=myapp"))
82+
```
83+
7384
### Define the Memcached spec and status
7485

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

0 commit comments

Comments
 (0)