Skip to content

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

Merged
hectorvent merged 5 commits into
mainfrom
fix/missing-instance-endpoint
Nov 4, 2026
Merged

hectorvent merged 5 commits into
mainfrom
fix/missing-instance-endpoint

Conversation

@hectorvent

@hectorvent hectorvent commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

For a named container that does not exist, the CLI fell back to the default endpoint, so status described the default instance and env, services and snapshot could point at or change it.

  • status no longer probes the default instance and reports endpoint: null.
  • env, services, az setup and the snapshot commands exit 1 with the next step.
  • wait keeps looking for the container until --timeout and ignores a server on the default port. doctor and version still run and do not probe it.
  • A profile's port is used before its container starts.
  • An endpoint from --endpoint, FLOCI_ENDPOINT or another host beats a local container's published port.

Breaking: scripts reading endpoint from status -o json as a string must handle null. Commands that used the default endpoint here now exit 1. An --endpoint or FLOCI_ENDPOINT on the default port is now honoured even when a local container publishes another port.

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

Product trees affected

  • AWS (root tree)
  • GCP (commands/gcp/)
  • Azure (commands/az/)
  • N/A (shared infrastructure, docs, CI)

Checklist

  • mvn test passes locally
  • New or updated tests added (or explained below why not needed)
  • README.md updated (if a command or flag changed)
  • Native binary verified (mvn package -Pnative), required if Jackson serialization or dependencies changed
  • Commit messages / PR title follow Conventional Commits: a feat/fix/perf subject becomes the release note, so CHANGELOG.md needs no hand edit
  • I have no more than 2 open, non-draft pull requests and no more than 4 open pull requests in total (drafts included) in this repository (maintainers and dependency bots are exempt).

Tests

MissingInstanceEndpointTest covers each case above, parameterized over all four trees where the behaviour varies. 785 tests, 0 failures. Compared main and this branch with a fat JAR against real docker, including Docker unreachable and a live server on the default port. Native build and smoke pass on linux/amd64 and darwin/arm64 with this change merged alongside the other open work, but the smoke script does not run these endpoint paths. OCI is covered too: the template has no box for it.

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>
@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous configured-port issue is fixed.

Summary

The PR stops commands from using the default instance when a named container has no known endpoint.

  • Profile ports and explicit endpoints now pick the intended server.
  • Commands stop when a named container has no known endpoint.
  • Diagnostics and wait no longer mistake the default server for a missing container.

Adding the required greptile_confidence label was blocked because GitHub authentication is unavailable.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Choose endpoint] --> B{Explicit endpoint or another host?}
  B -->|Yes| C[Use configured endpoint]
  B -->|No| D[Inspect selected container]
  D --> E{Published product port?}
  E -->|Yes| F[Use published port]
  E -->|No| G{Known configured endpoint?}
  G -->|Yes| C
  G -->|No| H[Report unknown or keep waiting]
Loading

Reviews (4) · Last reviewed commit: "fix(cli): treat a profile port equal to ..." · Reviewed by Greptile

…tatus

status reported endpoint null and exited 1 for a healthy server when FLOCI_ENDPOINT equalled the product default, because its check ignored the environment while the published port was skipped in favour of it. Addresses the review of #75.

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

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

# Conflicts:
#	README.md
#	plugin.json
#	src/main/java/io/floci/cli/commands/DoctorCommand.java
#	src/main/java/io/floci/cli/commands/EnvCommand.java
#	src/main/java/io/floci/cli/commands/az/AzEnvCommand.java
#	src/main/java/io/floci/cli/commands/gcp/GcpEnvCommand.java
#	src/main/java/io/floci/cli/commands/oci/OciEnvCommand.java
This branch changes the skill, and 1.0.3 shipped with #74.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
A profile with a non-default container and the product's default port yields the default endpoint, which read as no endpoint chosen, so env exited 1 and status reported null. The provider now records that the port came from the profile. A profile with neither a port nor an endpoint stays unknown. Addresses the review of #75.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
@hectorvent
hectorvent merged commit 587860d into main Nov 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant