Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Ensure /run is executable for backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
rgulewich committed Feb 15, 2019
1 parent 611c8d8 commit a483063
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions executor/mock/standalone/standalone_test.go
Expand Up @@ -141,6 +141,7 @@ func TestStandalone(t *testing.T) {
testCachedDockerPull,
testMetatron,
testRunTmpFsMount,
testExecSlashRun,
}
for _, fun := range testFunctions {
fullName := runtime.FuncForPC(reflect.ValueOf(fun).Pointer()).Name()
Expand Down Expand Up @@ -977,3 +978,16 @@ func testRunTmpFsMount(t *testing.T, jobID string) {
t.Fail()
}
}

// Test that we can execute files in `/run`
func testExecSlashRun(t *testing.T, jobID string) {
ji := &mock.JobInput{
ImageName: ubuntu.name,
Version: ubuntu.tag,
EntrypointOld: `/bin/bash -c 'echo "#!/bin/bash\necho works"' > /run/execme && chmod +x /run/execme && /run/execme`,
JobID: jobID,
}
if !mock.RunJobExpectingSuccess(ji) {
t.Fail()
}
}
2 changes: 1 addition & 1 deletion executor/runtime/docker/docker.go
Expand Up @@ -487,7 +487,7 @@ func (r *DockerRuntime) dockerConfig(c *runtimeTypes.Container, binds []string,

// Always setup tmpfs: it's needed to ensure Metatron credentials don't persist across reboots and for SystemD to work
hostCfg.Tmpfs = map[string]string{
"/run": "rw,noexec,nosuid,size=" + defaultRunTmpFsSize,
"/run": "rw,exec,nosuid,size=" + defaultRunTmpFsSize,
}

if r.storageOptEnabled {
Expand Down

0 comments on commit a483063

Please sign in to comment.