1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Rancher DesktopでPATHの自動追加はしない方がいい

Posted at

結論

Rancher DesktopでPATHを自動追加する設定にしてると、kubectlなどのツールが強制的に~/.rd/binにあるものが使われます

ツールの向き先が変わることでバージョンなど意図しない挙動になることがあるので、PATHは手動で設定するのをお勧めします

環境

Rancher Desktop: Version 1.20.0

どういうことか

Rancher Desktopでは以下のような設定があります

image.png

この設定を入れてると.zshrcなどの末尾に以下のコードが挿入されます

### MANAGED BY RANCHER DESKTOP START (DO NOT EDIT)
export PATH="/Users/<USER>/.rd/bin:$PATH"
### MANAGED BY RANCHER DESKTOP END (DO NOT EDIT)

これによってkubectlなどのツールが~/.rd/binを使用するようになります

$ ls ~/.rd/bin
./                             docker-credential-osxkeychain@
../                            helm@
docker@                        kubectl@
docker-buildx@                 kuberlr@
docker-compose@                nerdctl@
docker-credential-ecr-login@   rdctl@
docker-credential-none@        spin@

Homebrewでkubectlをインストールしているのに、いつの間にか~/.rd/binにあるkubectlが使われてたという事象に遭遇したという背景です

解決策

PATHの設定はManualにして、.zshrcなどに自分で以下の設定を書いて優先度を下げればOK

export PATH=$PATH:$HOME/.rd/bin
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?