lens icon indicating copy to clipboard operation
lens copied to clipboard

.bash_set_path usage with user defined kubectl binary

Open armenelruth opened this issue 2 years ago • 1 comments

Describe the bug the ".bash_profile" is not sourced if I use my own kubectl binary. Example: I do have function 'promptModification' in .bashrc that is sourced from .bash_profile. When I open terminal in Lens is says

bash: promptModification: command not found bash-3.2$

To Reproduce Steps to reproduce the behavior:

  1. Define the function 'promptModification' and set 'export PROMPT_COMMAND=promptModification' in .bashrc
  2. Ensure .bashrc is sourced from .bash_profile
  3. Open Lens
  4. Go to 'Preference->Kubernetes'
  5. Switch off "Download kubectl binaries matching the Kubernetes cluster version"
  6. Point to own kubectl binary at "PATH TO KUBECTL BINARY"
  7. Click "Esc" (Close preference pane)
  8. Open any connected K8S cluster (click cluster on left hotbar)
  9. Click "+" -> "Terminal session" at bottom of window
  10. See error

Expected behavior Using own kubectl binary should not stop the sourcing the .${SHELL}_profile in terminal session.

Screenshots no screenshots.

Environment (please complete the following information):

  • Lens Version: 5.2.5-latest.20211001.2
  • OS: MacOS Big Sur (11.6)
  • Installation method (e.g. snap or AppImage in Linux): Homebrew

Logs: When you run the application executable from command line you will see some logging output. Please paste them here:

debug:   ▪ Set kubectl version 1.20.8 for cluster version v1.20.1-mirantis-1-3-g71afa0ba032bfd using version map +9s
error:   ┏ undefined +349ms
error:   ┃ [1] {
error:   ┃ [2]   errno: -2,
error:   ┃ [3]   code: 'ENOENT',
error:   ┃ [4]   syscall: 'open',
error:   ┃ [5]   path: '/Users/<>/Library/Application Support/Lens/binaries/kubectl/1.20.8/.bash_set_path'
error:   ┗ [6] }

Kubeconfig: not related to kubeconfig

Additional context no additional context

armenelruth avatar Oct 22 '21 12:10 armenelruth

I cannot reproduce it. I thought I had initially but it was because I had misspelled the name of the function declaration in my .bashrc

Nokel81 avatar Dec 10 '21 17:12 Nokel81