// createPipelineServiceAccount reads the TEST_E2E_SERVICEACCOUNT_NAME environment variable. If the value is "generated", then nothing is done.
// Otherwise it will create the service account. No error occurs if the service account already exists.
createPipelineServiceAccount reads the TEST_E2E_SERVICEACCOUNT_NAME environment variable. If the value is "generated", then nothing is done.
Otherwise it will create the service account. No error occurs if the service account already exists.
// createPipelineServiceAccount reads the TEST_E2E_SERVICEACCOUNT_NAME environment variable . If the value is " generated " then nothing is done . // Otherwise it will create the service account . No error occurs if the service account already exists .
func createPipelineServiceAccount(ctx *framework.Context, f *framework.Framework, namespace string, timeout time.Duration, retry time.Duration) {
	serviceAccountName := os.Getenv(EnvVarServiceAccountName)
	if serviceAccountName == "generated" {
		Logf("Skipping creation of service account, generated one will be used per build run.")
	} else {
		serviceAccount := &corev1.ServiceAccount{
			ObjectMeta: metav1.ObjectMeta{
				Namespace: namespace,
				Name:      serviceAccountName,
			},
		}
		Logf("Creating '%s' service-account", serviceAccountName)
		err := f.Client.Create(goctx.TODO(), serviceAccount, cleanupOptions(ctx, timeout, retry))
		if err != nil && !apierrors.IsAlreadyExists(err) {
			Expect(err).ToNot(HaveOccurred(), "Error creating service account")
		}
	}
}
func createPipelineServiceAccount ( ctx * framework . Context , f * framework . Framework , namespace string , timeout time . Duration , retry time . Duration ) { serviceAccountName := os . Getenv ( EnvVarServiceAccountName ) if serviceAccountName == " " { Logf ( " " ) } else { serviceAccount := & corev1 . ServiceAccount { ObjectMeta : metav1 . ObjectMeta { Namespace : namespace , Name : serviceAccountName , } , } Logf ( " " , serviceAccountName ) err := f . Client . Create ( goctx . TODO ( ) , serviceAccount , cleanupOptions ( ctx , timeout , retry ) ) if err != nil && ! apierrors . IsAlreadyExists ( err ) { Expect ( err ) . ToNot ( HaveOccurred ( ) , " " ) } } }
createPipelineServiceAccount reads the TEST_E2E_SERVICEACCOUNT_NAME environment variable.
createPipelineServiceAccount reads the TEST_E2E_SERVICEACCOUNT_NAME environment variable .