Skip to content

Commit

Permalink
fix(executor): add executable permission to staged script (argoproj…
Browse files Browse the repository at this point in the history
…#12787)

Signed-off-by: Ingvar Mattsson <[email protected]>
Signed-off-by: Ingvar <[email protected]>
Co-authored-by: Ingvar Mattsson <[email protected]>
Co-authored-by: Anton Gilgur <[email protected]>
  • Loading branch information
3 people authored and Joibel committed Sep 19, 2024
1 parent 784a000 commit 1b68017
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion workflow/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,13 @@ func (we *WorkflowExecutor) LoadArtifacts(ctx context.Context) error {
func (we *WorkflowExecutor) StageFiles() error {
var filePath string
var body []byte
mode := os.FileMode(0o644)
switch we.Template.GetType() {
case wfv1.TemplateTypeScript:
log.Infof("Loading script source to %s", common.ExecutorScriptSourcePath)
filePath = common.ExecutorScriptSourcePath
body = []byte(we.Template.Script.Source)
mode = os.FileMode(0o755)
case wfv1.TemplateTypeResource:
if we.Template.Resource.ManifestFrom != nil && we.Template.Resource.ManifestFrom.Artifact != nil {
log.Infof("manifest %s already staged", we.Template.Resource.ManifestFrom.Artifact.Name)
Expand All @@ -283,7 +285,7 @@ func (we *WorkflowExecutor) StageFiles() error {
default:
return nil
}
err := os.WriteFile(filePath, body, 0o644)
err := os.WriteFile(filePath, body, mode)
if err != nil {
return argoerrs.InternalWrapError(err)
}
Expand Down

0 comments on commit 1b68017

Please sign in to comment.