Skip to content

Commit 90a9b0a

Browse files
authored
Merge pull request #15 from ktock/exec-mountroot-default
Add mountroot default value
2 parents 3d5e173 + b73ac20 commit 90a9b0a

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ If `ARGS` isn't provided, `/bin/sh` is used by default.
263263
Flags:
264264

265265
- `--image`: Execute command in the debuger image specified by `--image` flag of [`buildg debug`](#buildg-debug). If not specified, the command is executed on the rootfs of the current step.
266-
- `--mountroot value`: Mountpoint to mount the rootfs of the step. ignored if `--image` isn't specified.
266+
- `--mountroot value`: Mountpoint to mount the rootfs of the step. ignored if `--image` isn't specified. (default: `/debugroot`)
267267
- `--init-state`: Execute commands in an initial state of that step (experimental)
268268
- `--tty`, `-t`: Allocate tty (enabled by default)
269269
- `-i`: Enable stdin. (FIXME: must be set with tty) (enabled by default)

exec.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ If ARGS isn't provided, "/bin/sh" is used by default.
3232
cli.StringFlag{
3333
Name: "mountroot",
3434
Usage: "Mountpoint to mount the rootfs of the current step. Ignored if --image isn't specified.",
35+
Value: "/debugroot",
3536
},
3637
cli.BoolFlag{
3738
Name: "init-state",
@@ -122,12 +123,8 @@ func (h *handler) execContainer(ctx context.Context, cfg containerConfig) error
122123
})
123124
}
124125
if cfg.image != nil {
125-
mountroot := "/debugroot"
126-
if cfg.mountroot != "" {
127-
mountroot = cfg.mountroot
128-
}
129126
for i := range mounts {
130-
mounts[i].Dest = filepath.Join(mountroot, mounts[i].Dest)
127+
mounts[i].Dest = filepath.Join(cfg.mountroot, mounts[i].Dest)
131128
}
132129
mounts = append([]gwclient.Mount{
133130
{

0 commit comments

Comments
 (0)