Merge pull request #64034 from deads2k/cli-62-wait

Automatic merge from submit-queue (batch tested with PRs 64034, 64072, 64146, 64059, 64161). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add kubectl wait

Adds a `kubectl wait --for=[delete|condition=condition-name] resource/string` command.  This allows generic waiting on well behaved conditions and for a resource or set of resources to be deleted.

This was requested for delete to do foreground deletion

WIP because I need to add test cases.


@kubernetes/sig-cli-maintainers this is using a separation of concerns made possible by the genericclioptions to make an easily unit testable command.
@smarterclayton 

```release-note
adds a kubectl wait command
```
This commit is contained in:
Kubernetes Submit Queue
2018-05-22 19:20:12 -07:00
committed by GitHub
26 changed files with 1177 additions and 24 deletions

View File

@@ -2382,7 +2382,11 @@ run_namespace_tests() {
# Post-condition: namespace 'my-namespace' is created.
kube::test::get_object_assert 'namespaces/my-namespace' "{{$id_field}}" 'my-namespace'
# Clean up
kubectl delete namespace my-namespace
kubectl delete namespace my-namespace --wait=false
# make sure that wait properly waits for finalization
kubectl wait --for=delete ns/my-namespace
output_message=$(! kubectl get ns/my-namespace 2>&1 "${kube_flags[@]}")
kube::test::if_has_string "${output_message}" ' not found'
######################
# Pods in Namespaces #