-
Notifications
You must be signed in to change notification settings - Fork 296
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
chore: add methods to read or set docker contexts #9197
Conversation
0388bb9
to
3ad5f16
Compare
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.
Minor comments but approving.
}); | ||
|
||
contextBridge.exposeInMainWorld('switchDockerContext', async (contextName: string): Promise<DockerContextInfo[]> => { | ||
return ipcInvoke('docker-compatibility:switchDockerContext', contextName); |
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.
Minor: I think I'd prefer setDockerContext. I know there are typically going to be 2, but switch sounds like toggling between two states, where set sounds like picking from the list.
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.
there is always the default state, there is never an unknown state
related to containers#9026 Signed-off-by: Florent Benoit <[email protected]>
3ad5f16
to
8d17098
Compare
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.
Context are retrieved through the internal implementation dependant Docker specific file. Why not use docker context ls --format json instead ? Might be broken by Docker undocumented change, no ?
To not have a direct dependency on the docker CLI from the Podman Desktop core. |
Signed-off-by: Florent Benoit <[email protected]>
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.
LGTM Codewise
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.
LGTM
What does this PR do?
add methods to list and set the docker contexts
there is always a default context even when there is no files (like .docker/config.json or any .docker/context/** files) on the filesystem, it's what we're calling the system socket path.
unit tests provided
Screenshot / video of UI
What issues does this PR fix or reference?
related to #9026
How to test this PR?