From e2adcde55daea872e758f54ce36c95135a41f653 Mon Sep 17 00:00:00 2001 From: "A. Ishikawa" Date: Mon, 25 Jun 2018 10:41:02 +0900 Subject: [PATCH] Update a command to run correctly for a reader (#9167) # Issue The command of jobs does not run correctly if its job already finished. Some readers may confuse that they can't succeed to run a command to follow this tutorial. So, we should add `--show-all` option to show pods that may be completed. # The log to show that we need to add an --show-all option ``` $ kubectl get jobs NAME DESIRED SUCCESSFUL AGE busybox 1 0 27d hello-1529501040 1 1 2m hello-1529501100 1 1 1m hello-1529501160 1 1 43s $ kubectl get pods --selector=job-name=hello-1529501160 No resources found, use --show-all to see completed objects. $ kubectl get pods --show-all --selector=job-name=hello-1529501160 NAME READY STATUS RESTARTS AGE hello-1529501160-dckjv 0/1 Completed 0 1m ``` --- content/en/docs/tasks/job/automated-tasks-with-cron-jobs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/tasks/job/automated-tasks-with-cron-jobs.md b/content/en/docs/tasks/job/automated-tasks-with-cron-jobs.md index dc8cc0d9fd..fd6ff6ca5b 100755 --- a/content/en/docs/tasks/job/automated-tasks-with-cron-jobs.md +++ b/content/en/docs/tasks/job/automated-tasks-with-cron-jobs.md @@ -93,7 +93,7 @@ Note that the job name and pod name are different. ```shell # Replace "hello-4111706356" with the job name in your system -$ pods=$(kubectl get pods --selector=job-name=hello-4111706356 --output=jsonpath={.items..metadata.name}) +$ pods=$(kubectl get pods --show-all --selector=job-name=hello-4111706356 --output=jsonpath={.items..metadata.name}) $ echo $pods hello-4111706356-o9qcm