Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace shell command with chainable core api (#6390)
This is one part of our efforts to consolidate dagger CLI commands. It removes `dagger shell` in favor of using a `shell` api chained from the core `Container` type. For example, previously you'd do: `dagger shell my-ctr` Now you do: `dagger call my-ctr shell` This required some adjustments in the core API: 1. `Container` has a new field `withDefaultShell(args: [String!])` that can be used to configure the command to use for opening a shell with the container 1. `shellEndpoint: String!` on `Container` is replaced with `shell(args: [String!]) Terminal!`. * If `args` are specified, they override the command to run in the container's shell * Otherwise, this defaults to the command specified via `withDefaultShell` * As a fallback, `sh` will be executed --- Implementation details: The new `Terminal` type currently only has a field for the existing websocket endpoint, so same basic idea as before in terms of how its implemented. However, because its an object now we have more leeway to easily adjust it in the future if more fields are desired. This felt like the best solution possible in the short term while keeping options open in the long-term. `args` is optional and allows specifying the exact command to run in the interactive container. If not set, it first defaults to the entrypoint of the container and falls back to `sh` if those aren't set. Signed-off-by: Erik Sipsma <erik@dagger.io>
- Loading branch information