Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "pod", Short: "Wait for pod", Args: cobra.NoArgs, Run: func(c *cobra.Command, args []string) { clientset, defaultNamespace, _ := k8s.KubernetesClient() namespace := defaultNamespace if CmdFlagNamespace != "" { namespace = CmdFlagNamespace } podClient := clientset.CoreV1().Pods(namespace) wait_for_utils.WaitFor( CmdFlagTimeout, 100*time.Millisecond, func() (bool, bool, string, error) { pod, err := podClient.Get(context.TODO(), CmdFlagName, metav1.GetOptions{}) if err != nil { return wait_for_utils.WaitForResponseWaiting(err.Error()) } if pod.Status.Phase == "Failed" { return wait_for_utils.WaitForResponseFailed("Failed") } if pod.Status.Phase == "Succeeded" { 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.