Skip to content

Commit

Permalink
Print create/wait/delete messages for cnsenter pod
Browse files Browse the repository at this point in the history
  • Loading branch information
ssup2 committed Mar 23, 2021
1 parent 4b7f429 commit a5f9525
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/cmd/kpexec/kpexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ func (o *Options) Run(args []string, argsLenAtDash int) error {
}

// Create a cnsenter pod
fmt.Printf("Create cnsenter pod\n")
_, err = clientset.CoreV1().Pods(o.cnsPodNamespace).Create(context.TODO(), cnsPod, metav1.CreateOptions{})
if err != nil {
return fmt.Errorf("failed to create cnsetner pod : %+v", err)
Expand Down Expand Up @@ -457,7 +458,7 @@ func (o *Options) Run(args []string, argsLenAtDash int) error {
os.Exit(1)
}()
// Wait and check pod's status
fmt.Printf("Creating cnsenter pod\n")
fmt.Printf("Wait to run cnsenter pod\n")
for cnsPodEvent := range cnsPodWatch.ResultChan() {
tPod, _ = cnsPodEvent.Object.(*corev1.Pod)
if tPod.Status.Phase == corev1.PodRunning || tPod.Status.Phase == corev1.PodSucceeded || tPod.Status.Phase == corev1.PodFailed {
Expand Down

0 comments on commit a5f9525

Please sign in to comment.