GetServiceAccountNameFromTaskExecutionMetadata
Retrieves the service account name from the provided task execution metadata. It first attempts to get the service account from the security context's RunAs field, and if not found, falls back to the deprecated K8sServiceAccount field directly on the metadata.
def GetServiceAccountNameFromTaskExecutionMetadata(
taskExecutionMetadata: pluginmachinery_core.TaskExecutionMetadata
) - > string
Retrieves the service account name from the provided task execution metadata. This function first attempts to get the service account from the security context's run-as configuration, and if not found, falls back to a deprecated method of directly getting it from the task execution metadata.
Parameters
| Name | Type | Description |
|---|---|---|
| taskExecutionMetadata | pluginmachinery_core.TaskExecutionMetadata | The metadata object containing information about the task execution, including security context details. |
Returns
| Type | Description |
|---|---|
string | The Kubernetes service account name associated with the task execution. |