-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
feature request: support brew link --overwrite #1062
Comments
link --overwrite seems a bit dangerous to support in a DSL like this.
|
Thanks @MikeMcQuaid for taking a look at this. I've tried --force but it produces the same error. Our problem is that our brewfile includes:
Docker installs an older version of kubectl to /Applications/Docker.app/Contents/Resources/bin/kubectl and links it to /usr/local/bin/kubectl. But we need kubernetes-cli as a depedency of kubectx, and also because it's newer than the Docker version. It is possible to wrap the Brewfile in a bash script that does the overwrite, eg:
But it would be more convenient if we could do the overwrite within the Brewfile. |
@tekumara Yeh, I think you've convinced me here. Reopening and I'll review a PR for this. |
Docker installs kubectl to /Applications/Docker.app/Contents/Resources/bin/kubectl and links it to /usr/local/bin/kubectl. But it's an older version than kubernetes-cli. When running `setup upgrade` a newer version of Docker will overwrite kubernetes-cli. The next time `setup upgrade` runs and there's a newer version of kubernetes-cli it will show the error: ``` Linking /usr/local/Cellar/kubernetes-cli/1.23.4... Error: Could not symlink bin/kubectl Target /usr/local/bin/kubectl already exists. You may want to remove it: rm '/usr/local/bin/kubectl' To force the link and overwrite all conflicting files: brew link --overwrite kubernetes-cli To list all files that would be deleted: brew link --overwrite --dry-run kubernetes-cli ``` This PR adds `brew link --overwrite --dry-run kubernetes-cli` to the install script so we never have the Docker version of kubectl installed (and therefore don't get the error above) and always have the latest version of kubectl. Ideally this would be possible in the Brewfile itself, see Homebrew/homebrew-bundle#1062
Nube question: after the issue is closed, would it be possible to apply this behaviour by default? E.g.:
|
No, sorry. |
seems related https://github.com/Mesa3D/mesa/actions/runs/3425503489/jobs/5706360682 How to getting github actions more reliable |
|
To handle cases like:
The text was updated successfully, but these errors were encountered: