Repository navigation
Closed
Labels
area: coreCore filesystem operations and POSIX complianceeffort: mediumMedium effort - 1-2 dayspriority: criticalBlocking issue requiring immediate attentiontype: bugSomething isn't working as expected
Description
Context
configs/systemd/[email protected] calls objectfs mount --config ... --foreground and objectfs version in its ExecStartPre and ExecStart lines. Neither of these works today — cmd/objectfs/main.go only accepts two positional arguments (<URI> <mountpoint>) with no subcommand routing. The systemd unit is broken on every installed system.
What to implement
Restructure cmd/objectfs/main.go with stdlib subcommand dispatch (no new framework). Check os.Args[1] and route:
mount subcommand:
- Flags:
--config string,--foreground bool,--mount-point string,--log-level string,--cache-size string,--max-concurrency int - Positional:
<URI>and<mountpoint>(or--mount-pointflag) - When
--foregroundis absent, daemonize (fork and re-exec self with--foreground)
unmount subcommand:
- Accepts a single mountpoint argument
- Calls
fusermount3 -u <mountpoint>or equivalent
version subcommand:
- Prints
objectfs version <VERSION>and exits 0 - Used in systemd
ExecStartPre
Backward compatibility:
- If
os.Args[1]starts withs3://, treat as legacy form and route to mount path — no config file required, use defaults
Acceptance criteria
objectfs mount s3://bucket /mnt/pointworksobjectfs mount --config /etc/objectfs/foo.yaml --foreground s3://bucket /mnt/pointworksobjectfs unmount /mnt/pointworksobjectfs versionprints version and exits 0objectfs s3://bucket /mnt/pointstill works (backward compat)objectfs --helpshows all subcommands
Sequencing
Must land before B1-2 (systemd fix depends on mount subcommand) and B1-3 (fstab helper execs objectfs mount).
Metadata
Metadata
Assignees
Labels
area: coreCore filesystem operations and POSIX complianceeffort: mediumMedium effort - 1-2 dayspriority: criticalBlocking issue requiring immediate attentiontype: bugSomething isn't working as expected
Activity
scttfrdmn commentedon Aug 3, 2026
Landed in
e8750ebonv0.11.0-cli-subcommands.objectfs mount,objectfs unmount(also spelledumount),version,help, dispatched onargs[0]with stdlibflagand no new dependency. The legacy form is preserved rather than deprecated: a first argument carrying a URI scheme or a leading dash routes tomount, so every pre-v0.11.0 invocation still works, while a bare word that is not a command is a usage error naming itself —objectfs moutn s3://b /mntdoes not become an attempt to mount a bucket calledmoutn.Three things the issue did not anticipate:
Each subcommand needs its own
FlagSet.flag.CommandLinecannot parse a flag that appears after a positional argument, so a single package-level flag set could not have acceptedobjectfs mount --config x s3://b /mntat all. Related: Go'sflagstops at the first non-flag argument, soobjectfs mount s3://b /mnt --foregroundpreviously left--foregroundas a third positional and silently did not apply it. It is now reported.main()had to shrink for any of this to be testable. It calledlog.Fatalf, which callsos.Exit, which takes the test binary with it — that is why.coverage-floorsrecorded this package as untestable. It is now three lines aroundrun(args, stdout, stderr) int, andcmd/objectfshas a coverage floor for the first time at 77%. What remains uncovered is the mount lifecycle, which needs/dev/fuse.New flags:
--mount-point, so a mount point can come from a flag rather than a positional (which is what makes the systemd template in #135 possible), and--foreground, which names what already happens — ObjectFS does not fork — accepted because init systems pass it and refusing it would break invocations that are correct about the behaviour.Also in this commit:
internal/awsname, so bucket names and storage URIs have one validator instead of a check at each call site. It is deliberately narrower than S3's CreateBucket rules, verified against real S3 in us-west-2:HeadBucketonMyBucketreturns 404 and onmy_bucketreturns 403 — well-formed names for buckets this account cannot see — whilebandabreturn 400. Uppercase and underscore names were creatable in us-east-1 until 2018 and still exist, so applying the creation rules would refuse to mount a bucket S3 will serve.Documentation is gated rather than transcribed:
internal/config/docs_symbols_test.gonow scrapes both the flag set and the subcommand set frommain.go— flags by regexp, subcommands bygo/parserfinding the switch whose tag isargs[0]— and checks everyobjectfscommand line in every markdown file against them.objectfs mountis approved andobjectfs statusis still rejected without anyone maintaining a list.v0.11.0: subcommands, a security gate, and prices that know their region