Skip to content

Commit

Permalink
show current context in the list
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarped committed Oct 1, 2023
1 parent 75f78ae commit 648ce60
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 295 deletions.
4 changes: 1 addition & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func rootFunc(cmd *cobra.Command, args []string) {
log.Debug().Str("file", f.Name()).Msg("not a valid kubeconfig")
continue
}
listItems = append(listItems, tui.NewItem(kc.Name, "TBD"))
listItems = append(listItems, tui.NewItem(kc.Name, kc.CurrentContext))
}

// we create a new model
Expand All @@ -147,8 +147,6 @@ func rootFunc(cmd *cobra.Command, args []string) {
return
}

fmt.Println("you selected:", m.Choice)

// Once the BubbleTeam runtime is done, we receive here the choice
if m.Choice == "" {
log.Debug().Msg("exit without selecting any item")
Expand Down
2 changes: 1 addition & 1 deletion cmd/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func useWithoutName(db *kv.DB, kubeconfigPath string) error {
return err
}
for _, kc := range items {
listItems = append(listItems, tui.NewItem(kc.Name, "TBD"))
listItems = append(listItems, tui.NewItem(kc.Name, kc.CurrentContext))
}

// we create a new model
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/charmbracelet/lipgloss v0.7.1
github.com/pterm/pterm v0.12.33
github.com/rs/zerolog v1.26.1
github.com/spf13/cobra v1.3.0
github.com/spf13/cobra v1.7.0
)

require (
Expand All @@ -20,7 +20,7 @@ require (
github.com/go-logr/logr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/gookit/color v1.5.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
Expand All @@ -39,12 +39,12 @@ require (
github.com/sahilm/fuzzy v0.1.0 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.3.8 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
Expand All @@ -60,7 +60,7 @@ require (

require (
github.com/akrylysov/pogreb v0.10.1
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
k8s.io/client-go v0.23.1
)
Loading

0 comments on commit 648ce60

Please sign in to comment.