GetServiceAccountEmail extracts email from a service account resource name.
(name string)
| 712 | |
| 713 | // GetServiceAccountEmail extracts email from a service account resource name. |
| 714 | func GetServiceAccountEmail(name string) (string, error) { |
| 715 | tokens, err := GetNameParentTokens(name, ServiceAccountNamePrefix) |
| 716 | if err != nil { |
| 717 | return "", err |
| 718 | } |
| 719 | return tokens[0], nil |
| 720 | } |
| 721 | |
| 722 | // GetWorkloadIdentityEmail extracts email from a workload identity resource name. |
| 723 | func GetWorkloadIdentityEmail(name string) (string, error) { |
no test coverage detected