- Notifications
You must be signed in to change notification settings - Fork905
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
Conversation
dda97d9
to2984d4e
Compared49f84e
to011a8aa
Compareae52380
to5cf4ae7
Compare011a8aa
to63f93bc
Compare5cf4ae7
to2dc395d
Compare63f93bc
to0deaab8
Compare2dc395d
toea0125d
Compare0deaab8
to8796ba3
Compare// 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
toadbfd45
Compare709f374
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