Skip to content

Commit

Permalink
accept extra args in RunInContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin committed Sep 10, 2023
1 parent 013a1f2 commit 48e16a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cengine/containers-run.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package cengine

// RunInContainer executes a command inside a new container with the specified
// ContainerExecOptions.
func (ce *Ce) RunInContainer(imageOrId string, interactive bool, command string) (err error) {
// RunInContainer executes a command inside a new container.
func (ce *Ce) RunInContainer(imageOrId string, interactive bool, command string, extraArgs ...string) (err error) {
args := []string{"run"}
if interactive {
args = append(args, "-it")
}
args = append(args, "--rm")
args = append(args, "--entrypoint", command)
args = append(args, imageOrId)
args = append(args, extraArgs...)

_, err = ce.RunCommand(args, []string{}, false)
return
Expand Down

0 comments on commit 48e16a9

Please sign in to comment.