Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RootCmd is the root command of the plugin RootCmd = &cobra.Command{ Use: "kubectl glance", Short: "Kubectl glance", RunE: func(cmd *cobra.Command, args []string) error { s := spinner.New(spinner.CharSets[14], 100*time.Millisecond) s.Start() GlobalSettings.InitClient() w := tabwriter.NewWriter(os.Stdout, 3, 4, 1, ' ', tabwriter.AlignRight) nodesOK, nodesKO, cpuAllocatable, memAllocatable, err := GlobalSettings.GetNodes() fmt.Fprintln( w, fmt.Sprintf("Nodes\t %s (%s Unschedulable) Allocatable: CPU %s cores, Mem %s bytes", color.GreenString(strconv.Itoa(nodesOK)), color.RedString(strconv.Itoa(nodesKO)), color.GreenString(cpuAllocatable), color.GreenString(memAllocatable), ), ) resources, err := GlobalSettings.GetRessources() for resource, value := range resources { fmt.Fprintln( w, fmt.Sprintf("%s\t %s", strings.Title(resource), color.GreenString(strconv.Itoa(value)), ), ) } pv, err := GlobalSettings.GetPersistentVolumes() fmt.Fprintln( w, fmt.Sprintf("Persistent Volumes\t %s", color.GreenString(strconv.Itoa(pv)), ), ) s.Stop() w.Flush() return err }, } // GlobalSettings holds common options/utils GlobalSettings *globalSettings )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.