Skip to content

Commit

Permalink
Merge pull request #5 from hallyn/2023-09-07/invert-ro
Browse files Browse the repository at this point in the history
Invert --ro
  • Loading branch information
hallyn authored Sep 7, 2023
2 parents 94e78ce + fe97406 commit 21ccd8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
skopeo copy docker://zothub.io/machine/bootkit/bootkit:v0.0.16.230901-squashfs oci:oci:bootkit-squashfs
mkdir upper
lxc-usernsexec -s << EOF
atomfs mount --upper=upper oci:bootkit-squashfs dest
atomfs mount --writeable --upperdir=upper oci:bootkit-squashfs dest
[ -d dest/bootkit ]
touch dest/zz
atomfs umount dest
Expand Down
12 changes: 6 additions & 6 deletions mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ var mountCmd = cli.Command{
Usage: "Directory to use as writeable overlay",
},
cli.BoolFlag{
Name: "ro",
Usage: "Do not make writeable using an overlay",
Name: "writeable",
Usage: "Make writeable using an overlay",
},
},
}

func mountUsage(me string) error {
return fmt.Errorf("Usage: atomfs mount [--upper=/tmp/upperdir] [--ro=true] ocidir:tag target")
return fmt.Errorf("Usage: atomfs mount [--writeable [--upper=/tmp/upperdir]] ocidir:tag target")
}

func findImage(ctx *cli.Context) (string, string, error) {
Expand Down Expand Up @@ -104,10 +104,10 @@ func doMount(ctx *cli.Context) error {
return err
}

if ctx.Bool("ro") {
err = bind(target, rodest)
} else {
if ctx.Bool("writeable") {
err = overlay(target, rodest, metadir, ctx)
} else {
err = bind(target, rodest)
}

complete = true
Expand Down

0 comments on commit 21ccd8d

Please sign in to comment.