fix(cli)!: stop using the default instance for a missing container

status no longer probes the default instance for a named container with no known
endpoint, and env, services, snapshot and az setup exit 1 with the next step
instead of acting on it. wait keeps looking for the container until --timeout, and
doctor and version still run. A profile's port is used before its container
starts, and an endpoint from --endpoint, FLOCI_ENDPOINT or another host beats a
local container's published port.

BREAKING CHANGE: in status -o json, endpoint is null when the selected container
has no known endpoint. env, services, snapshot and az setup exit 1 in that case,
where they used to use the default endpoint. An --endpoint or FLOCI_ENDPOINT on
the default port is now honoured even when a local container publishes another
port.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
Hector Ventura committed 2026-11-03 23:53:22 -06:00
1 parent ac52515471
commit 33367ecb9b
17 files changed
+469 -57

No files matched your search

@@ -57,7 +57,7 @@ class ProfilePrecedenceTest {
writeProfile("probe", FULL_PROFILE);
CommandSpec spec = leafSpec("start", "--profile", "probe");
assertEquals("http://localhost:4566", spec.findOption("--endpoint").getValue());
assertEquals("http://localhost:4599", spec.findOption("--endpoint").getValue());
assertEquals("floci-probe", spec.findOption("--container").getValue());
assertEquals("floci/floci:enforced", spec.findOption("--image").getValue());
assertEquals(Integer.valueOf(4599), spec.findOption("--port").getValue());
@@ -118,7 +118,7 @@ class ProfilePrecedenceTest {
for (String command : new String[]{"status", "logs", "wait", "doctor", "env", "services"}) {
CommandSpec spec = leafSpec(command, "--profile", "probe");
assertEquals("floci-probe", spec.findOption("--container").getValue(), command);
assertEquals("http://localhost:4566", spec.findOption("--endpoint").getValue(), command);
assertEquals("http://localhost:4599", spec.findOption("--endpoint").getValue(), command);
}
}