Skip to content

Commit 9a3cfaf

Browse files
authored
Merge pull request #1391 from ocampeau/label-selector-doc
add label selector doc
2 parents fa8f192 + 7b77bdc commit 9a3cfaf

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

content/docs/trust/trust-manager/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,24 @@ spec:
5454
name: "my-db-tls"
5555
key: "ca.crt"
5656

57+
# Here is another Secret source, but this time using a label selector instead of a Secret's name.
58+
- secret:
59+
selector:
60+
matchLabels:
61+
fruit: apple
62+
key: "ca.crt"
63+
5764
# A ConfigMap in the "trust" namespace; see "Trust Namespace" below for further details
5865
- configMap:
5966
name: "my-org.net"
6067
key: "root-certs.pem"
68+
69+
# Here is another ConfigMap source, but this time using a label selector instead of a ConfigMap's name.
70+
- configMap:
71+
selector:
72+
matchLabels:
73+
fruit: apple
74+
key: "ca.crt"
6175

6276
# A manually specified string
6377
- inLine: |
@@ -95,6 +109,11 @@ spec:
95109

96110
Support for `Secret` targets must be explicitly enabled in the trust-manager controller; see details below under "Enable Secret targets".
97111

112+
Both `ConfigMap` and `Secret` also support specifying label selectors to select multiple resources at once, which is useful in dynamic
113+
environments where the name of the `ConfigMap` or `Secret` is known only at runtime. When adding a source, either of type `ConfigMap` or `Secret`,
114+
the fields `name` and `selector` are mutually exclusive: one **must** be set, but not both.
115+
116+
98117
All sources and target options are documented in the trust-manager [API reference documentation](./api-reference.md).
99118

100119
#### Targets

content/docs/trust/trust-manager/api-reference.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,16 @@ ConfigMap is a reference to a ConfigMap's `data` key, in the trust Namespace.
172172
<td><b>name</b></td>
173173
<td>string</td>
174174
<td>
175-
Name is the name of the source object in the trust Namespace.<br/>
175+
Name is the name of the source object in the trust Namespace. If not set, `selector` must be set.<br/>
176176
</td>
177-
<td>true</td>
177+
<td>false</td>
178+
</tr><tr>
179+
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#labelselector-v1-meta">selector</a></b></td>
180+
<td>LabelSelector</td>
181+
<td>
182+
A LabelSelector object to reference, by labels, a list of source objects in the trust Namespace. If not set, `name` must be set.<br/>
183+
</td>
184+
<td>false</td>
178185
</tr></tbody>
179186
</table>
180187

@@ -204,9 +211,16 @@ Secret is a reference to a Secrets's `data` key, in the trust Namespace.
204211
<td><b>name</b></td>
205212
<td>string</td>
206213
<td>
207-
Name is the name of the source object in the trust Namespace.<br/>
214+
Name is the name of the source object in the trust Namespace. If not set, `selector` must be set.<br/>
208215
</td>
209-
<td>true</td>
216+
<td>false</td>
217+
</tr><tr>
218+
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#labelselector-v1-meta">selector</a></b></td>
219+
<td>LabelSelector</td>
220+
<td>
221+
A LabelSelector object to reference, by labels, a list of source objects in the trust Namespace. If not set, `name` must be set.<br/>
222+
</td>
223+
<td>false</td>
210224
</tr></tbody>
211225
</table>
212226

0 commit comments

Comments
 (0)