cmd/

directory
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: Apache-2.0

README

cmd

Overview

cmd holds the two package main binaries of the github.com/coder/openstorage module. It has no source files of its own. Each binary composes packages from internal/ and adds no domain logic beyond configuration, wiring, and operator commands.

  • openstorage is the service binary. serve runs the API, Git, eventing, sync, and background-job stack on one HTTP listener. The other subcommands are offline operator tools.
  • dst is a developer tool. It replays one deterministic simulation run by seed through internal/simtest.

Subdirectories & Boundaries

  • openstorage: ./openstorage/README.md - Composition root. Resolves OPENSTORAGE_* environment variables and flags into a validated config (config.go), wires the stores and services (wire*.go), and serves /api/, /healthz, and Git smart HTTP at /, with an optional metrics listener. Subcommands: serve, hook, keygen, mint, signing-key, list-packs, purge-repo, s3wal-meta, version. A failure that reaches [openstorage/main.go:fatalf] exits 1. A flag parse error exits 2, because every subcommand flag set uses flag.ExitOnError ([openstorage/main.go:cmdServe] and the other subcommand entry points). The hook subcommand also exits 42 at two crash test knobs, only when OPENSTORAGE_TEST_MODE=1 and OPENSTORAGE_TEST_CRASH is after-reserve or after-s3 ([../internal/githttp/hook.go:testMode], [../internal/githttp/hook.go:EnvCrash]). Verify with go test ./cmd/openstorage/... -tags=openstorage_viewcheck -count=1 -race -timeout=30m.
  • dst: ./dst/README.md - Deterministic simulation replay. Flags -seed, -steps, -nodes, -backend (sqlite or s3wal), -v, -keep. Exits 0 clean, 1 invariant violation, 2 infrastructure failure. Verify with go test ./cmd/dst/... -tags=openstorage_viewcheck -count=1 -race -timeout=30m. cmd/dst has no test files, so this command only compiles the package.

Directories

Path Synopsis
Command dst reproduces deterministic simulation runs (issue #3): given a seed it replays the exact op trace the DST tests execute, printing the trace and any invariant violations.
Command dst reproduces deterministic simulation runs (issue #3): given a seed it replays the exact op trace the DST tests execute, printing the trace and any invariant violations.
Serve/CLI configuration resolution: flags take precedence, then the canonical OPENSTORAGE_* environment variables, then the SPIKE_*/legacy spike aliases (PG_URL, BLOB_URL) so phase-0 invocations keep working.
Serve/CLI configuration resolution: flags take precedence, then the canonical OPENSTORAGE_* environment variables, then the SPIKE_*/legacy spike aliases (PG_URL, BLOB_URL) so phase-0 invocations keep working.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL