mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-22 21:50:47 -05:00
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>
This commit is contained in:
3 files changed
+49
-5
No files matched your search
@@ -109,7 +109,13 @@ public class ResetCommand implements Callable<Integer> {
|
||||
return new Target(null, "Container '" + global.container + "' is not running (state: "
|
||||
+ info.get().state() + "), so nothing was reset." + how);
|
||||
}
|
||||
return new Target(global.endpointFromPorts(info.get().ports(), global.endpoint), null);
|
||||
Optional<String> published = global.publishedEndpoint(info.get().ports(), global.endpoint);
|
||||
if (chosen && published.isEmpty()) {
|
||||
// No port to find it by: the configured endpoint may well be another instance.
|
||||
return new Target(null, "Container '" + global.container
|
||||
+ "' publishes no port for the emulator, so nothing was reset." + how);
|
||||
}
|
||||
return new Target(published.orElse(global.endpoint), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user