Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions runner/internal/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,6 @@ func (ex *RunExecutor) Run(ctx context.Context) (err error) {

ex.setJobCredentials(ctx)

if err := ex.prepareJobWorkingDir(ctx); err != nil {
ex.SetJobStateWithTerminationReason(
ctx,
types.JobStateFailed,
types.TerminationReasonExecutorError,
fmt.Sprintf("Failed to set up the working dir (%s)", err),
)
return fmt.Errorf("prepare job working dir: %w", err)
}

if err := ex.setupRepo(ctx); err != nil {
ex.SetJobStateWithTerminationReason(
ctx,
Expand All @@ -226,6 +216,16 @@ func (ex *RunExecutor) Run(ctx context.Context) (err error) {
return fmt.Errorf("setup files: %w", err)
}

if err := ex.prepareJobWorkingDir(ctx); err != nil {
ex.SetJobStateWithTerminationReason(
ctx,
types.JobStateFailed,
types.TerminationReasonExecutorError,
fmt.Sprintf("Failed to set up the working dir (%s)", err),
)
return fmt.Errorf("prepare job working dir: %w", err)
}

cleanupCredentials, err := ex.setupCredentials(ctx)
if err != nil {
ex.SetJobState(ctx, types.JobStateFailed)
Expand Down
1 change: 0 additions & 1 deletion runner/internal/executor/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func (ex *RunExecutor) AddFileArchive(id string, src io.Reader) error {
}

// setupFiles must be called from Run
// ex.jobWorkingDir must be already created
func (ex *RunExecutor) setupFiles(ctx context.Context) error {
for _, fa := range ex.jobSpec.FileArchives {
archivePath := path.Join(ex.archiveDir, fa.Id)
Expand Down