-
Notifications
You must be signed in to change notification settings - Fork 309
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
Docker CLI Plugins: Use cliPluginsExtraDirs
on Windows
#7435
Docker CLI Plugins: Use cliPluginsExtraDirs
on Windows
#7435
Conversation
Due to an upcoming change to how the plugins will be instaled on Windows, they need to be a directory that does _not_ contain `docker-credential-*`. Therefore, download them into a separate directory instead. Actual usage will be fixed in follow-up commits. Signed-off-by: Mark Yen <[email protected]>
The previous commit downloaded the plugins to a different directory; update the macOS and Linux integration manager to use that directory instead. Windows will be fixed later. We still add symlinks to `~/.rd/bin/` so that if the user runs e.g. `docker-compose` instead of `docker compose`, the executable will still be found. Signed-off-by: Mark Yen <[email protected]>
Instead of copying the docker CLI plugins to `~/.docker/cli-plugins`, set up `~/.docker/config.json` to add the Rancher Desktop docker CLI plugins directory as an extra directory to scan for plugins. On Windows, this appears to take precedence over `~/.docker/cli-plugins`, therefore resolving issues with not updating the plugins. For symmetry, also do the same for WSL distributions. Signed-off-by: Mark Yen <[email protected]>
Now that we ship the plugins in a separate directory, we also need to add that directory to $PATH so that if the user wants to call it directly it can be done. Signed-off-by: Mark Yen <[email protected]>
The plugins have been moved, so we need to provide a different directory if they are called for. This is used to locate `docker-compose` during extension installation. Signed-off-by: Mark Yen <[email protected]>
a39513c
to
6b38b5a
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.
Looks good, but I have some stylistic feedback/questions, if you want to take a look.
pkg/rancher-desktop/integrations/__tests__/unixIntegrationManager.spec.ts
Outdated
Show resolved
Hide resolved
} else if filepath.Dir(target) == binPath { | ||
// Remove the symlink, ignoring any errors. | ||
_ = os.Remove(entryPath) | ||
} else { |
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.
Should we delete dangling symlinks too?
- Exclude docker credential helpers when checking for docker CLI plugins in moby client - Rename various variables - Other misc fixes Signed-off-by: Mark Yen <[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.
Thanks, LGTM
On Windows, we don't have symlinks available. So instead of copying the plugins to
~/.docker/cli-plugins/
, add acliPluginsExtraDirs
config entry instead so we look for them there.On Windows it appears to prefer that (so leaving the old plugins in
~/.docker/cli-plugins
is harmless; on Linux/mac it seems to prefer~/.docker/cli-plugins
(which makes no sense to me, but ¯\_(ツ)_/¯)Note that this PR also moves all the plugins to their own directory (instead of
resources/platform/bin
), because we don't want to add everything else to the search path.Fixes #7308