mirror of
https://github.com/ahmetb/kubectx.git
synced 2026-03-10 16:02:14 +00:00
Compare commits
1 Commits
master
...
abalkan/ku
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
711beb5fc5 |
@@ -46,6 +46,14 @@ func (op InteractiveSwitchOp) Run(_, stderr io.Writer) error {
|
||||
return fmt.Errorf("kubeconfig error: %w", err)
|
||||
}
|
||||
|
||||
ctxNames, err := kc.ContextNames()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get context names: %w", err)
|
||||
}
|
||||
if len(ctxNames) == 0 {
|
||||
return errors.New("no contexts found in the kubeconfig file")
|
||||
}
|
||||
|
||||
cmd := exec.Command("fzf", "--ansi", "--no-preview")
|
||||
var out bytes.Buffer
|
||||
cmd.Stdin = os.Stdin
|
||||
|
||||
Reference in New Issue
Block a user