prow/pod-utils/gcs/target.go
func PathForSpec(spec *downwardapi.JobSpec, pathSegment RepoPathBuilder) string {
	switch spec.Type {
	case prowapi.PeriodicJob, prowapi.PostsubmitJob:
		return path.Join(NonPRLogs, spec.Job, spec.BuildID)
	case prowapi.PresubmitJob:
		return path.Join(PRLogs, "pull", pathSegment(spec.Refs.Org, spec.Refs.Repo), strconv.Itoa(spec.Refs.Pulls[0].Number), spec.Job, spec.BuildID)
	case prowapi.BatchJob:
		return path.Join(PRLogs, "pull", "batch", spec.Job, spec.BuildID)
	default:
		logrus.Fatalf("unknown job spec type: %v", spec.Type)
	}
	return ""
}
func PathForSpec(spec *downwardapi.JobSpec, pathSegment RepoPathBuilder) string {
	switch spec.Type {
	case prowapi.PeriodicJob, prowapi.PostsubmitJob:
		return path.Join(NonPRLogs, spec.Job, spec.BuildID)
	case prowapi.PresubmitJob:
		return path.Join(PRLogs, "pull", pathSegment(spec.Refs.Org, spec.Refs.Repo), strconv.Itoa(spec.Refs.Pulls[0].Number), spec.Job, spec.BuildID)
	case prowapi.BatchJob:
		return path.Join(PRLogs, "pull", "batch", spec.Job, spec.BuildID)
	default:
		logrus.Fatalf("unknown job spec type: %v", spec.Type)
	}
	return ""
}
func PathForSpec ( spec * downwardapi . JobSpec , pathSegment RepoPathBuilder ) string { switch spec . Type { case prowapi . PeriodicJob , prowapi . PostsubmitJob : return path . Join ( NonPRLogs , spec . Job , spec . BuildID ) case prowapi . PresubmitJob : return path . Join ( PRLogs , " " , pathSegment ( spec . Refs . Org , spec . Refs . Repo ) , strconv . Itoa ( spec . Refs . Pulls [ 0 ] . Number ) , spec . Job , spec . BuildID ) case prowapi . BatchJob : return path . Join ( PRLogs , " " , " " , spec . Job , spec . BuildID ) default : logrus . Fatalf ( " " , spec . Type ) } return " " }
// PathForSpec determines the GCS path prefix for files uploaded
// for a specific job spec
PathForSpec determines the GCS path prefix for files uploaded for a specific job spec