INNER CODE UNIT · Go
showFuzzySearch
danielfoehrKn/kubeswitch · pkg/main.go:205
func showFuzzySearch(storeIDToStore map[string]storetypes.KubeconfigStore, showPreview bool) (string, string, error) {
// display selection dialog for all kubeconfig context names
idx, err := fuzzyfinder.Find(
&allKubeconfigContextNames,
func(i int) string {
return readFromAllKubeconfigContextNames(i)
},
getFuzzyFinderOptions(storeIDToStore, showPreview)...,
)
if err != nil {
return "", "", err
}
// map selection back to kubeconfig
selectedContext := readFromAllKubeconfigContextNames(idx)
kubeconfigPath := readFromContextToPathMapping(selectedContext)