Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ListJobCmd = &cobra.Command{ Use: "list-jobs", Short: "prints list of jobs in a cluster under the given namespace", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { namespace, _ := cmd.Flags().GetString("namespace") client := registry.GetKubeClient(registry.KubeClientKey) jobList, err := client.BatchV1(). Jobs(namespace). List(context.Background(), metav1.ListOptions{}) if err != nil { return errors.Errorf("error in retrieving job list %s", err) } tbl := createTable() for _, job := range jobList.Items { tbl.AppendRow(table.Row{job.ObjectMeta.Name, status(job)}) } tbl.SetStyle(table.StyleColoredYellowWhiteOnBlack) tbl.Render() return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.