func ActivateServiceAccount(keyFilePath string) error {
	cmd := command.New(
		"gcloud",
		"auth",
		"activate-service-account",
		"--key-file="+keyFilePath,
	)
	return cmd.RunSuccess()
}
ActivateServiceAccount activates the service account with gcloud.
package gcloud
import (
	"encoding/csv"
	"fmt"
	"io"
	"strings"
	"github.com/sirupsen/logrus"
	"sigs.k8s.io/release-utils/command"
)
type Token string
func GetServiceAccountToken(
	serviceAccount string,
	useServiceAccount bool) (Token, error) {
	args := []string{
		"auth",
		"print-access-token",
	}
	args = MaybeUseServiceAccount(serviceAccount, useServiceAccount, args)
	cmd := command.New("gcloud", args...)
	std, err := cmd.RunSilentSuccessOutput()
	if err != nil {
		logrus.Errorf("could not execute cmd %v", cmd)
		return "", err
	}
	stdout := std.Output()
	token := Token(strings.TrimSpace(stdout))
	return token, nil
}
func MaybeUseServiceAccount(
	serviceAccount string,
	useServiceAccount bool,
	cmd []string) []string {
	if useServiceAccount && len(serviceAccount) > 0 {
		cmd = append(cmd, "")
		copy(cmd[2:], cmd[1:])
		cmd[1] = fmt.Sprintf("--account=%v", serviceAccount)
	}
	return cmd
}
func ActivateServiceAccounts(keyFilePaths string) error {
	r := csv.NewReader(strings.NewReader(keyFilePaths))
	for {
		record, err := r.Read()
		if err == io.EOF {
			break
		}
		if err != nil {
			logrus.Fatal(err)
		}
		for _, keyFilePath := range record {
			if err := ActivateServiceAccount(keyFilePath); err != nil {
				logrus.Fatal(err)
			}
		}
	}
	return nil
}