Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Removed unneeded overwriteCache parameter in favor of global executio…
Browse files Browse the repository at this point in the history
…nConfig

Signed-off-by: Nick Müller <[email protected]>
  • Loading branch information
Nick Müller committed Nov 16, 2022
1 parent 038d43e commit 96037c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/create/execution_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func createExecutionRequestForWorkflow(ctx context.Context, workflowName, projec
}
}

return createExecutionRequest(lp.Id, inputs, securityContext, authRole, targetExecName, executionConfig.OverwriteCache), nil
return createExecutionRequest(lp.Id, inputs, securityContext, authRole, targetExecName), nil
}

func createExecutionRequestForTask(ctx context.Context, taskName string, project string, domain string,
Expand Down Expand Up @@ -98,7 +98,7 @@ func createExecutionRequestForTask(ctx context.Context, taskName string, project
Version: task.Id.Version,
}

return createExecutionRequest(id, inputs, securityContext, authRole, targetExecName, executionConfig.OverwriteCache), nil
return createExecutionRequest(id, inputs, securityContext, authRole, targetExecName), nil
}

func relaunchExecution(ctx context.Context, executionName string, project string, domain string,
Expand Down Expand Up @@ -145,7 +145,7 @@ func recoverExecution(ctx context.Context, executionName string, project string,
}

func createExecutionRequest(ID *core.Identifier, inputs *core.LiteralMap, securityContext *core.SecurityContext,
authRole *admin.AuthRole, targetExecName string, overwriteCache bool) *admin.ExecutionCreateRequest {
authRole *admin.AuthRole, targetExecName string) *admin.ExecutionCreateRequest {

if len(targetExecName) == 0 {
targetExecName = "f" + strings.ReplaceAll(uuid.New().String(), "-", "")[:19]
Expand All @@ -168,7 +168,7 @@ func createExecutionRequest(ID *core.Identifier, inputs *core.LiteralMap, securi
AuthRole: authRole,
SecurityContext: securityContext,
ClusterAssignment: clusterAssignment,
OverwriteCache: overwriteCache,
OverwriteCache: executionConfig.OverwriteCache,
},
Inputs: inputs,
}
Expand Down
10 changes: 10 additions & 0 deletions cmd/create/execution_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,13 @@ func TestCreateExecutionRequestForTask(t *testing.T) {
executionConfig.KubeServiceAcct = ""
})
}

func TestCreateExecutionForRelaunchOverwritingCache(t *testing.T) {
s := setup()
createExecutionUtilSetup()
executionConfig.OverwriteCache = true
relaunchRequest.OverwriteCache = true // ensure request has overwriteCache param set
s.MockAdminClient.OnRelaunchExecutionMatch(s.Ctx, relaunchRequest).Return(executionCreateResponse, nil)
err := relaunchExecution(s.Ctx, "execName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "")
assert.Nil(t, err)
}

0 comments on commit 96037c7

Please sign in to comment.