Allow KVM access on request
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-04-18 09:18:40 +02:00
parent 3a7b0940d8
commit 65cddc2ed7
2 changed files with 15 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ type (
Actor string
Verbose bool
NoForcePull bool
Kvm bool
}
Plugin struct {
@@ -94,7 +95,11 @@ func (p Plugin) Exec() error {
}
if p.Action.NoForcePull {
cmdArgs = append(cmdArgs, "-p=false")
cmdArgs = append(cmdArgs, "--pull=false")
}
if p.Action.Kvm {
cmdArgs = append(cmdArgs, "--privileged")
}
if p.Daemon.Disabled {
@@ -111,6 +116,9 @@ func (p Plugin) Exec() error {
bindModifiers = ":z"
}
cmdArgs = append(cmdArgs, "--container-options", fmt.Sprintf("--volume=%s:%s%s", hostWorkDirPath, guestWorkDirPath, bindModifiers))
if p.Action.Kvm {
cmdArgs = append(cmdArgs, "--volume=/dev/kvm:/dev/kvm")
}
}
cmd := exec.Command("act", cmdArgs...)