You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `$remoteClusterName` | `{{ .ClusterName }}` | the workspace's cluster name (e.g. "1084s8ceexsehjm2") |
191
194
| `$remoteNamespace` | `{{ .Object.metadata.namespace }}` | the original namespace used by the consumer inside the workspace |
192
195
| `$remoteNamespaceHash` | `{{ .Object.metadata.namespace \| shortHash }}` | first 20 hex characters of the SHA-1 hash of `$remoteNamespace` |
193
196
| `$remoteName` | `{{ .Object.metadata.name }}` | the original name of the object inside the workspace (rarely used to construct local namespace names) |
194
197
| `$remoteNameHash` | `{{ .Object.metadata.name \| shortHash }}` | first 20 hex characters of the SHA-1 hash of `$remoteName` |
198
+
{% endraw %}
195
199
196
200
Note that `ClusterPath` was never available in `$variable` form.
197
201
@@ -316,6 +320,7 @@ and easy to use, but require a "link" in the primary object that would point to
316
320
317
321
Here's an example on how to use references to locate the related object.
318
322
323
+
{% raw %}
319
324
```yaml
320
325
apiVersion: syncagent.kcp.io/v1alpha1
321
326
kind: PublishedResource
@@ -367,6 +372,7 @@ spec:
367
372
# pattern: '...'
368
373
# replacement: '...'
369
374
```
375
+
{% endraw %}
370
376
371
377
#### Templates
372
378
@@ -403,11 +409,12 @@ type localObjectNamingContext struct {
403
409
In the simplest form, a template can replace a reference:
404
410
405
411
* reference: `.spec.secretName`
406
-
* Go template: `{{ .Object.spec.secretName }}`
412
+
* Go template: {% raw %}`{{ .Object.spec.secretName }}`{% endraw %}
407
413
408
414
Just like with references, the configured template is evaluated twice, once for each side of the
409
415
synchronization. You can use the `Side` variable to allow for fully customized names on each side:
410
416
417
+
{% raw %}
411
418
```yaml
412
419
spec:
413
420
...
@@ -418,6 +425,7 @@ spec:
418
425
template:
419
426
template: `{{ if eq .Side "kcp" }}name-in-kcp{{ else }}name-on-service-cluster{{ end }}`
420
427
```
428
+
{% endraw %}
421
429
422
430
See [Templating](templating.md) for more information on how to use templates in PublishedResources.
423
431
@@ -455,6 +463,7 @@ how peculiar the underlying operators on the service clusters are.
455
463
456
464
Here is an example on how to use label selectors:
457
465
466
+
{% raw %}
458
467
```yaml
459
468
apiVersion: syncagent.kcp.io/v1alpha1
460
469
kind: PublishedResource
@@ -509,10 +518,8 @@ spec:
509
518
replacement: "bar-\\1"
510
519
511
520
# or
512
-
{% raw %}
513
521
template:
514
522
template: "{{ .Name }}-foo"
515
-
{% endraw %}
516
523
517
524
# Like with references, the namespace can (or must) be configured explicitly.
518
525
# You do not need to also use label selectors here, you can mix and match
@@ -524,6 +531,7 @@ spec:
524
531
# pattern: '...'
525
532
# replacement: '...'
526
533
```
534
+
{% endraw %}
527
535
528
536
There are two possible usages of Go templates when using label selectors. See [Templating](templating.md)
529
537
for more information on how to use templates in PublishedResources in general.
0 commit comments