diff --git a/hack/make-rules/test-cmd.sh b/hack/make-rules/test-cmd.sh index 893225e38e..d708d0c841 100755 --- a/hack/make-rules/test-cmd.sh +++ b/hack/make-rules/test-cmd.sh @@ -1163,7 +1163,7 @@ __EOF__ kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' kubectl delete pvc b-pvc 2>&1 "${kube_flags[@]}" - ## kubectl apply --prune --prune-whitelist(-w) + ## kubectl apply --prune --prune-whitelist # Pre-Condition: no POD exists kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' # apply pod a @@ -1171,7 +1171,7 @@ __EOF__ # check right pod exists kube::test::get_object_assert 'pods a' "{{${id_field}}}" 'a' # apply svc and don't prune pod a by overwriting whitelist - kubectl apply --prune -l prune-group=true -f hack/testdata/prune/svc.yaml -w core/v1/Service 2>&1 "${kube_flags[@]}" + kubectl apply --prune -l prune-group=true -f hack/testdata/prune/svc.yaml --prune-whitelist core/v1/Service 2>&1 "${kube_flags[@]}" kube::test::get_object_assert 'service prune-svc' "{{${id_field}}}" 'prune-svc' kube::test::get_object_assert 'pods a' "{{${id_field}}}" 'a' # apply svc and prune pod a with default whitelist diff --git a/pkg/kubectl/cmd/apply.go b/pkg/kubectl/cmd/apply.go index 620e68c514..1c29eeb955 100644 --- a/pkg/kubectl/cmd/apply.go +++ b/pkg/kubectl/cmd/apply.go @@ -109,7 +109,7 @@ func NewCmdApply(f cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.AddValidateFlags(cmd) cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on") cmd.Flags().Bool("all", false, "[-all] to select all the specified resources.") - cmd.Flags().StringArrayP("prune-whitelist", "w", []string{}, "Overwrite the default whitelist with for --prune") + cmd.Flags().StringArray("prune-whitelist", []string{}, "Overwrite the default whitelist with for --prune") cmdutil.AddDryRunFlag(cmd) cmdutil.AddPrinterFlags(cmd) cmdutil.AddRecordFlag(cmd)