- Notifications
You must be signed in to change notification settings - Fork1.1k
feat(agent/agentcontainers): add Exec method to devcontainers CLI#18244
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dda97d9 to2984d4eCompared49f84e to011a8aaCompareae52380 to5cf4ae7Compare011a8aa to63f93bcCompare5cf4ae7 to2dc395dCompare63f93bc to0deaab8Compare2dc395d toea0125dCompare0deaab8 to8796ba3Compare| // WithContainerID sets the container ID to target a specific container. | ||
| // Can only be used with the Exec command. | ||
| funcWithContainerID(idstring)DevcontainerCLIOptions { | ||
| returnfunc(o*devcontainerCLIUpConfig) { | ||
| ifo.command!="exec" { | ||
| panic("developer error: WithContainerID can only be used with the Exec command") | ||
| } | ||
| o.args=append(o.args,"--container-id",id) | ||
| } | ||
| } | ||
| // WithRemoteEnv sets environment variables for the Exec command. | ||
| // Can only be used with the Exec command. | ||
| funcWithRemoteEnv(env...string)DevcontainerCLIOptions { | ||
| returnfunc(o*devcontainerCLIUpConfig) { | ||
| ifo.command!="exec" { | ||
| panic("developer error: WithRemoteEnv can only be used with the Exec command") | ||
| } | ||
| for_,e:=rangeenv { | ||
| o.args=append(o.args,"--remote-env",e) | ||
| } | ||
| } | ||
| } | ||
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.
Given that these two options can only be used withdevcontainer exec, I think it makes more sense to keep them as a different type. I like the idea of having the uniform signature of...DevcontainerCLIOptions but this is offset by potential run-time errors instead of compile-time errors.
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.
Yeah, agreed, I'll change it.
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.
Fixed inadbfd45
This change adds Exec to the devcontainer CLI.Updatescoder/internal#621
8796ba3 toadbfd45Compare709f374 intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This change adds Exec to the devcontainer CLI.
Updatescoder/internal#621