Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WatchAllPodsCmd = &cobra.Command{ Use: "a", Short: "Watch all the pods in a k8s cluster", Long: "Watch all the pods in a k8s cluster", Run: func(cmd *cobra.Command, args []string) { ktoolgrid.InitGrid() defer ui.Close() kubeconfig, _ := config.KubeConfig() pane := widgets.NewParagraph() pane.Text = pods.GetPods(kubeconfig) pane.Title = "Context | All pods" grid, uiEvents, ticker, err := ktoolgrid.SinglePane(pane) utils.ErrorHandler(err) for { select { case e := <-uiEvents: switch e.ID { case "q", "<C-c>": return case "<Resize>": payload := e.Payload.(ui.Resize) grid.SetRect(0, 0, payload.Width, payload.Height) ui.Clear() ui.Render(grid) } case <-ticker: pane.Text = pods.GetPods(kubeconfig) ui.Render(grid) } } }, }
WatchAllPodsCmd watches all pods in k8s cluster
View Source
var WatchPodLogsCommand = &cobra.Command{ Use: "l", Short: "Watch a pods logs", Long: "Watch a pods logs", Run: func(cmd *cobra.Command, args []string) { views.WatchPodLogs() }, }
WatchPodLogsCommand watches a pod logs in k8s cluster
Functions ¶
func CheckError ¶
func CheckError(err error)
CheckError prints err to stderr and exits with code 1 if err is not nil. Otherwise, it is a no-op.
func RegisterCleanup ¶
func RegisterCleanup() chan int
RegisterCleanup cleans up when call to cancel is initiated
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.