Skip to content
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

k9s doesn't honor KUBECONFIG environment variable when replacing value for plugin #2862

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rvarunrathod
Copy link

@rvarunrathod rvarunrathod commented Sep 1, 2024

k9s does not utilize the KUBECONFIG environment variable, when flag value of --kubeconfig is empty.

I am using plugin that will copy log command to clipboard.
The plugin

plugins:
 logs-kubectl-cmd:
   shortCut: Ctrl-L
   confirm: false
   description: Copy log cmd to clipboard
   scopes:
     - pods
   background: true
   command: bash
   args:
     - -c
     - "echo kubectl logs -f $COL-NAME -n $NAMESPACE --context $CONTEXT --kubeconfig $KUBECONFIG | pbcopy"

when I added logger here I found that value of *kcfg is empty

var cfg string
kcfg := c.Flags().KubeConfig
if kcfg != nil && *kcfg != "" {
  cfg = *kcfg
  log.Info().Msg(fmt.Sprintf("Here is the KUBECONFIG, %v, %v", kcfg, cfg))
}

logs

12:12AM INF Here is the KUBECONFIG, 0x14000c6f200,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant