Skip to content

Commit fa37359

Browse files
committed
improve docs
On-behalf-of: @SAP christoph.mewes@sap.com
1 parent 6b11c8a commit fa37359

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

sdk/apis/syncagent/v1alpha1/published_resource.go

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,17 @@ type PublishedResourceSpec struct {
102102
// ResourceNaming describes how the names for local objects should be formed.
103103
type 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

0 commit comments

Comments
 (0)