@@ -23,12 +23,22 @@ type WorkerResourceTemplateSpec struct {
2323 // Must include apiVersion, kind, and spec. metadata.name and metadata.namespace
2424 // are generated by the controller; do not set them.
2525 //
26- // String values in the spec may use Go template expressions:
27- // {{ .K8sNamespace }}, {{ .TWDName }}, {{ .TemporalNamespace }}, {{ .BuildID }}
26+ // The controller auto-injects fields when they are present as an empty object ({}):
2827 //
29- // The controller auto-injects two well-known fields when present as an empty object:
30- // scaleTargetRef: {} - injected to point at the versioned Deployment (HPA, WPA, etc.)
31- // matchLabels: {} - injected with the versioned Deployment selector labels (PDB, etc.)
28+ // scaleTargetRef: {}
29+ // Injected to point at the versioned Deployment. Use this for HPAs, WPAs, and
30+ // other autoscaler CRDs that need a scale target.
31+ //
32+ // spec.selector.matchLabels: {}
33+ // Injected with the versioned Deployment's pod selector labels. Use this for
34+ // PodDisruptionBudgets and other resources that select pods.
35+ //
36+ // spec.metrics[*].external.metric.selector.matchLabels: {} (or with user labels)
37+ // The controller appends worker_deployment_name, worker_deployment_build_id, and
38+ // temporal_namespace to any External metric selector where matchLabels is present.
39+ // User labels (e.g. task_type: "Activity") coexist alongside the injected keys.
40+ // Do not set worker_deployment_name, worker_deployment_build_id, or
41+ // temporal_namespace manually — the webhook will reject them.
3242 // +kubebuilder:validation:Required
3343 // +kubebuilder:pruning:PreserveUnknownFields
3444 Template runtime.RawExtension `json:"template"`
0 commit comments