-
Notifications
You must be signed in to change notification settings - Fork 529
Add StartedAt field to container list output #336
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
|
@zk2k2 Can you run |
| struct Item: Sendable { | ||
| let bundle: ContainerClient.Bundle | ||
| var state: State | ||
| var startedAt: Date? |
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.
startedAt is really only relevant when the container is alive, isn't it? We might want to consider associating this value with State.alive.
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 thing seems a bit awkward on the SandboxService side of things (no fault of yours, you're just having to work with it) is that we have a model for runtime state that uses different types on the client (RuntimeStatus) and server (State) side.
The approach in the NetworkService is to have a NetworkState enum type that has an associated value for configuration data for the non-running states, and both config and runtime state values for the running states, and NetworkState is used on both client and server.
Let me look into whether we can take this approach here and I'll offer some guidance.
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.
@zk2k2 If you're still interested in moving this forward, have a look at the ContainersService now. The ContainersService.Item type has now been eliminated which should make adding this field a lot simpler.
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.
Hi @jglogan, sure I'll check it out
Summary
This pull request adds support for tracking and exposing the container
startedAttimestamp throughout the container lifecycle.Fixes apple/container#302.
Changes
startedAt: Date?to:ContainerSnapshotClientContainerPrintableContainerContainersService.containerStartHandlerusingDate()Item.asSnapshot()startedAtin:container list --format jsonoutputasRowfor table display (ISO 8601 format)