INNER CODE UNIT · Go
getFuzzyFinderOptions
danielfoehrKn/kubeswitch · pkg/main.go:227
func getFuzzyFinderOptions(storeIDToStore map[string]storetypes.KubeconfigStore, showPreview bool) []fuzzyfinder.Option {
options := []fuzzyfinder.Option{fuzzyfinder.WithHotReloadLock(hotReloadLock.RLocker())}
if showPreview {
log := logrus.New()
withPreviewWindow := fuzzyfinder.WithPreviewWindow(func(i, w, h int) string {
if !showPreview || i == -1 {
return ""
}
// read the content of the kubeconfig here and display
hotReloadLock.RLock()
currentContextName := readFromAllKubeconfigContextNames(i)
hotReloadLock.RUnlock()
path := readFromContextToPathMapping(currentContextName)
tags := readFromPathToTagsMapping(path)
storeID := readFromPathToStoreID(path)