// buildTestData gets the us the Build test data set up
buildTestData gets the us the Build test data set up
// buildTestData gets the us the Build test data set up
func buildRunTestData(ns string, identifier string, buildRunCRPath string) (*operator.BuildRun, error) {
	rootDir, err := getRootDir()
	if err != nil {
		return nil, err
	}
	obj, err := readAndDecode(rootDir + "/" + buildRunCRPath)
	if err != nil {
		return nil, err
	}
	buildRun := obj.(*operator.BuildRun)
	buildRun.SetNamespace(ns)
	buildRun.SetName(identifier)
	buildRun.Spec.BuildRef.Name = identifier
	serviceAccountName := os.Getenv(EnvVarServiceAccountName)
	if serviceAccountName == "generated" {
		buildRun.Spec.ServiceAccount = &operator.ServiceAccount{
			Generate: true,
		}
	} else {
		buildRun.Spec.ServiceAccount = &operator.ServiceAccount{
			Name: &serviceAccountName,
		}
	}
	return buildRun, err
}
func buildRunTestData ( ns string , identifier string , buildRunCRPath string ) ( * operator . BuildRun , error ) { rootDir , err := getRootDir ( ) if err != nil { return nil , err } obj , err := readAndDecode ( rootDir + " " + buildRunCRPath ) if err != nil { return nil , err } buildRun := obj . ( * operator . BuildRun ) buildRun . SetNamespace ( ns ) buildRun . SetName ( identifier ) buildRun . Spec . BuildRef . Name = identifier serviceAccountName := os . Getenv ( EnvVarServiceAccountName ) if serviceAccountName == " " { buildRun . Spec . ServiceAccount = & operator . ServiceAccount { Generate : true , } } else { buildRun . Spec . ServiceAccount = & operator . ServiceAccount { Name : & serviceAccountName , } } return buildRun , err }
buildTestData gets the us the Build test data set up
buildTestData gets the us the Build test data set up