mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-11 17:50:58 +00:00
feat: SELinux lables for --bind (#906)
This commit is contained in:
parent
0ef1451bcc
commit
b8ac81e9dd
1 changed files with 5 additions and 0 deletions
|
@ -17,6 +17,8 @@ import (
|
|||
"github.com/mitchellh/go-homedir"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
selinux "github.com/opencontainers/selinux/go-selinux"
|
||||
|
||||
"github.com/nektos/act/pkg/common"
|
||||
"github.com/nektos/act/pkg/container"
|
||||
"github.com/nektos/act/pkg/model"
|
||||
|
@ -90,6 +92,9 @@ func (rc *RunContext) GetBindsAndMounts() ([]string, map[string]string) {
|
|||
if runtime.GOOS == "darwin" {
|
||||
bindModifiers = ":delegated"
|
||||
}
|
||||
if selinux.GetEnabled() {
|
||||
bindModifiers = ":z"
|
||||
}
|
||||
binds = append(binds, fmt.Sprintf("%s:%s%s", rc.Config.Workdir, rc.Config.ContainerWorkdir(), bindModifiers))
|
||||
} else {
|
||||
mounts[name] = rc.Config.ContainerWorkdir()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue