Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "job", Short: "Wait for job", Args: cobra.NoArgs, Run: func(c *cobra.Command, args []string) { clientset, defaultNamespace, _ := k8s.KubernetesClient() namespace := defaultNamespace if CmdFlagNamespace != "" { namespace = CmdFlagNamespace } jobsClient := clientset.BatchV1().Jobs(namespace) wait_for_utils.WaitFor( CmdFlagTimeout, 100*time.Millisecond, func() (bool, bool, string, error) { job, err := jobsClient.Get(context.TODO(), CmdFlagName, metav1.GetOptions{}) if err != nil { return wait_for_utils.WaitForResponseWaiting(err.Error()) } if job.Status.Failed == 1 { return wait_for_utils.WaitForResponseFailed("Failed") } if job.Status.Succeeded == 1 { return wait_for_utils.WaitForResponseSucceeded("Succeeded") } return wait_for_utils.WaitForResponseWaiting("Running") }, ) }, }
View Source
var CmdFlagName string
View Source
var CmdFlagNamespace string
View Source
var CmdFlagTimeout int
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.