Commit Graph
4 Commits
Author SHA1 Message Date
Hector Ventura 885e49f81a fix(reset): reset the server a profile or FLOCI_ENDPOINT names, not a local container of the default name (#64)
* fix(reset): reset the server a profile or FLOCI_ENDPOINT names, not a local container of the default name

With no container selected, an endpoint that came from a profile or the environment was replaced by the port of a container running locally under the default name, so reset --yes could wipe the wrong instance. Such an endpoint is now used as given, like a typed one.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(reset): reset nothing when the configured endpoint and a running default container are different servers

A profile carries a container name next to its endpoint, and every created profile is seeded with the default one. Using the endpoint outright could then reset a server other than a container the profile also names. When the two disagree neither is picked; the user says which with --endpoint or --container.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(reset): require a configured container to be running and to agree with a configured endpoint

A container that a profile or FLOCI_CONTAINER supplies is selected even when it has the default name, so a missing or stopped one resets nothing instead of falling back to the endpoint. A configured container and endpoint must be the same server. For a remote Docker host the published port is on the daemon's machine, so the endpoint is compared with that host, and a remote container without an endpoint is not reset through localhost.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(reset): treat a Docker daemon on this machine reached over TCP as local

tcp://127.0.0.1:2375 is this machine's daemon, so its published ports are local and a reset goes ahead as with a socket. The README sentence about exiting 1 now covers only the cases where reset refuses.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(reset): keep a Docker daemon reached over SSH remote, loopback address or not

ssh://user@127.0.0.1:2222 is a forwarded port to a VM or another machine. Treating it as local would let reset --yes go to localhost on this machine.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-11 21:10:58 -05:00
Hector Ventura de3ca7f171 feat(cli): add --json, --no-emoji, config profile edit and a warning for servers too old for the CLI (#62)
* feat(cli): add --json, --no-emoji, config profile edit and a warning for servers too old for the CLI

--json is shorthand for --output json. Marks are plain ASCII with --no-emoji, when output is piped and under NO_COLOR. config profile edit opens a profile in VISUAL or EDITOR and checks it still reads. status and version warn on stderr when the AWS server is older than the minimum the CLI supports.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* feat(cli): keep the upgrade hint on the selected instance and read quoted editor commands

The old-server hint names the instance it is about and suggests a restart, which keeps that instance's settings. The update notice follows --no-emoji and NO_COLOR. VISUAL and EDITOR are split like a shell would, so a quoted path with spaces works.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* feat(cli): keep Windows paths in editor values and say what to do for a pinned image

A backslash in VISUAL or EDITOR is an escape only before a space or a quote, so Windows paths come through intact. The old-server hint explains that restart keeps a pinned tag and how to change it.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* feat(config): let profile edit open a profile that no longer parses

edit asked the store to parse the profile before opening it, so the one profile that needed repairing could not be opened. A file holding YAML's null is now reported as a profile without settings instead of failing with an exception.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-11 09:12:44 -05:00
Hector Ventura bd4fa0f134 fix(cli): end every error message with what to do next (#58)
* fix(cli): end every error message with what to do next

Docker, snapshot, update and config profile errors now say how to recover (check Docker, run doctor or status, fix or delete the profile file, pass the missing profile name) instead of stopping at the failure. A test keeps new error messages to the convention.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(cli): keep the next step after docker's own output and name the instance in snapshot hints

Docker's error output ends in a newline and can span lines, which read as 'already has a next step' and hid the hint. The exception now knows whether its text is docker's output or the CLI's own advice. Snapshot hints select the same instance again.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-10 23:02:30 -05:00
Hector Ventura fa306b38a6 feat(reset): add floci reset to delete every resource in a running emulator (#55)
* feat(reset): add floci reset to delete every resource in a running emulator

floci reset (and floci gcp/az/oci reset) calls the emulator's state reset endpoint, so a test run can start clean without restarting the container. It asks for confirmation on a terminal; --yes skips the prompt and is required when there is no terminal. A server without the endpoint (floci-az today) gets a 'not available' message.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* feat(reset): never guess which server to reset

A typed --endpoint is used as given instead of being replaced by a local container's port, and a container the user selected has to be found running: a missing or stopped one resets nothing rather than falling back to the default instance. The confirmation goes through a seam, with tests for every answer.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* feat(reset): stop when a selected container publishes no port for the emulator

A selected container that is running without a matching published port has nothing to be found by, and the configured endpoint may be another instance.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* feat(reset): find a selected instance by the emulator's port, not the configured host port

A profile for an instance on its own host port names that port in its endpoint, while the container still listens on the emulator's; reset matched the wrong one and refused such instances.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-10 22:07:41 -05:00