From 1d4e99420ec4c903af0f9fe659ef4bffd59784a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E4=B8=AD=E8=B0=8510171568?= Date: Tue, 29 Dec 2020 21:08:03 +0800 Subject: [PATCH] add more usage info for kubectl wait option --for add more usage info for kubectl wait option --for Kubernetes-commit: 033e4a58182fb90e36d5f6cc3f291a2ea114998a --- pkg/cmd/wait/wait.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/wait/wait.go b/pkg/cmd/wait/wait.go index d781a76f..6cc5b550 100644 --- a/pkg/cmd/wait/wait.go +++ b/pkg/cmd/wait/wait.go @@ -62,6 +62,9 @@ var ( # Wait for the pod "busybox1" to contain the status condition of type "Ready". kubectl wait --for=condition=Ready pod/busybox1 + # The default value of status condition is true, you can set false. + kubectl wait --for=condition=Ready=false pod/busybox1 + # Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command. kubectl delete pod/busybox1 kubectl wait --for=delete pod/busybox1 --timeout=60s`) @@ -134,7 +137,7 @@ func (flags *WaitFlags) AddFlags(cmd *cobra.Command) { flags.ResourceBuilderFlags.AddFlags(cmd.Flags()) cmd.Flags().DurationVar(&flags.Timeout, "timeout", flags.Timeout, "The length of time to wait before giving up. Zero means check once and don't wait, negative means wait for a week.") - cmd.Flags().StringVar(&flags.ForCondition, "for", flags.ForCondition, "The condition to wait on: [delete|condition=condition-name].") + cmd.Flags().StringVar(&flags.ForCondition, "for", flags.ForCondition, "The condition to wait on: [delete|condition=condition-name]. The default status value of condition-name is true, you can set false with condition=condition-name=false") } // ToOptions converts from CLI inputs to runtime inputs