prow/pod-utils/downwardapi/jobspec.go
func EnvForType(jobType prowapi.ProwJobType) []string {
	baseEnv := []string{jobNameEnv, JobSpecEnv, jobTypeEnv, prowJobIDEnv, buildIDEnv, prowBuildIDEnv}
	refsEnv := []string{repoOwnerEnv, repoNameEnv, pullBaseRefEnv, pullBaseShaEnv, pullRefsEnv}
	pullEnv := []string{pullNumberEnv, pullPullShaEnv}

	switch jobType {
	case prowapi.PeriodicJob:
		return baseEnv
	case prowapi.PostsubmitJob, prowapi.BatchJob:
		return append(baseEnv, refsEnv...)
	case prowapi.PresubmitJob:
		return append(append(baseEnv, refsEnv...), pullEnv...)
	default:
		return []string{}
	}
}
func EnvForType(jobType prowapi.ProwJobType) []string {
	baseEnv := []string{jobNameEnv, JobSpecEnv, jobTypeEnv, prowJobIDEnv, buildIDEnv, prowBuildIDEnv}
	refsEnv := []string{repoOwnerEnv, repoNameEnv, pullBaseRefEnv, pullBaseShaEnv, pullRefsEnv}
	pullEnv := []string{pullNumberEnv, pullPullShaEnv}

	switch jobType {
	case prowapi.PeriodicJob:
		return baseEnv
	case prowapi.PostsubmitJob, prowapi.BatchJob:
		return append(baseEnv, refsEnv...)
	case prowapi.PresubmitJob:
		return append(append(baseEnv, refsEnv...), pullEnv...)
	default:
		return []string{}
	}
}
func EnvForType ( jobType prowapi . ProwJobType ) [ ] string { baseEnv := [ ] string { jobNameEnv , JobSpecEnv , jobTypeEnv , prowJobIDEnv , buildIDEnv , prowBuildIDEnv } refsEnv := [ ] string { repoOwnerEnv , repoNameEnv , pullBaseRefEnv , pullBaseShaEnv , pullRefsEnv } pullEnv := [ ] string { pullNumberEnv , pullPullShaEnv } switch jobType { case prowapi . PeriodicJob : return baseEnv case prowapi . PostsubmitJob , prowapi . BatchJob : return append ( baseEnv , refsEnv ... ) case prowapi . PresubmitJob : return append ( append ( baseEnv , refsEnv ... ) , pullEnv ... ) default : return [ ] string { } } }
// EnvForType returns the slice of environment variables to export for jobType
EnvForType returns the slice of environment variables to export for jobType