@@ -102,10 +102,17 @@ type PublishedResourceSpec struct {
102102// ResourceNaming describes how the names for local objects should be formed.
103103type ResourceNaming struct {
104104 // The name field allows to control the name the local objects created by the Sync Agent.
105- // If left empty, "$remoteNamespaceHash-$remoteNameHash" is assumed. This guarantees unique
106- // names as long as the cluster name ($remoteClusterName) is used for the local namespace
105+ // If left empty, the default value is:
106+ //
107+ // "{{ .Object.metadata.namespace | sha3short }}-{{ .Object.metadata.name | sha3short }}"
108+ //
109+ // This guarantees unique names as long as the cluster name is used for the local namespace
107110 // (the default unless configured otherwise).
108- // This is a string with placeholders. The following placeholders can be used:
111+ //
112+ // This value is a Go template, see the documentation for the available variables and functions.
113+ //
114+ // Alternatively (but deprecated), this value can be a simple string using one of the following
115+ // placeholders:
109116 //
110117 // - $remoteClusterName -- the kcp workspace's cluster name (e.g. "1084s8ceexsehjm2")
111118 // - $remoteNamespace -- the original namespace used by the consumer inside the kcp
@@ -116,11 +123,17 @@ type ResourceNaming struct {
116123 // (rarely used to construct local namespace names)
117124 // - $remoteNameHash -- first 20 hex characters of the SHA-1 hash of $remoteName
118125 //
126+ // Authors are advised to use Go templates instead, as the custom variable syntax is deprecated
127+ // and will be removed from a future release of the Sync Agent.
119128 Name string `json:"name,omitempty"`
120129
121130 // For namespaced resources, the this field allows to control where the local objects will
122- // be created. If left empty, "$remoteClusterName" is assumed.
123- // This is a string with placeholders. The following placeholders can be used:
131+ // be created. If left empty, "{{ .ClusterName }}" is assumed.
132+ //
133+ // This value is a Go template, see the documentation for the available variables and functions.
134+ //
135+ // Alternatively (but deprecated), this value can be a simple string using one of the following
136+ // placeholders:
124137 //
125138 // - $remoteClusterName -- the kcp workspace's cluster name (e.g. "1084s8ceexsehjm2")
126139 // - $remoteNamespace -- the original namespace used by the consumer inside the kcp
@@ -131,6 +144,8 @@ type ResourceNaming struct {
131144 // (rarely used to construct local namespace names)
132145 // - $remoteNameHash -- first 20 hex characters of the SHA-1 hash of $remoteName
133146 //
147+ // Authors are advised to use Go templates instead, as the custom variable syntax is deprecated
148+ // and will be removed from a future release of the Sync Agent.
134149 Namespace string `json:"namespace,omitempty"`
135150}
136151
@@ -217,8 +232,6 @@ type RelatedResourceObjectSpec struct {
217232 Selector * RelatedResourceObjectSelector `json:"selector,omitempty"`
218233 // Reference points to a field inside the main object. This reference is
219234 // evaluated on both source and destination sides to find the related object.
220- //
221- // Deprecated: Use Go templates instead.
222235 Reference * RelatedResourceObjectReference `json:"reference,omitempty"`
223236 // Template is a Go templated string that can make use of variables to
224237 // construct the resulting string.
0 commit comments