-
Notifications
You must be signed in to change notification settings - Fork 542
CLI: stop and kill should error on not found containers #878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
We should print a clear error message to stderr on if a container can't be found, as well as exiting with a 1 exit code.
cd90009 to
ace9702
Compare
| for id in containerIds { | ||
| if let container = containerMap[id] { | ||
| containers.append(container) | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need an error for trying to signal a non-running container here?
| @Argument(help: "Container IDs") | ||
| var containerIds: [String] = [] | ||
|
|
||
| struct KillError: Error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if this could be instead be moved into ContainerizationClient as public struct PartialSuccessError: Error?
| let allContainers = try await ClientContainer.list() | ||
| let containerMap = Dictionary(uniqueKeysWithValues: allContainers.map { ($0.id, $0) }) | ||
|
|
||
| for id in containerIds { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run state checks aren't wanted/needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The daemon returns an error if it's not running
| } | ||
|
|
||
| for (_, err) in error.failed { | ||
| allErrors.append("Error from APIServer: \(err)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API server
| } | ||
|
|
||
| for (_, err) in error.failed { | ||
| allErrors.append("Error from APIServer: \(err.localizedDescription)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API server
| import ContainerizationOS | ||
| import Foundation | ||
|
|
||
| struct StandardError: TextOutputStream, Sendable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should print a clear error message to stderr on if a container can't be found, as well as exiting with a 1 exit code.
Type of Change