Change:
This works: Are we using /var/run for testing?
Curiously travis shows a similar error message regarding /var/run/kubernetes, but it isn't failing: I suspect the /var/run/kubernetes issue is not what's causing the failure here.
However, I am able to reproduce the failure on my machine. I note that in your case, the fatal error says For me, it says The ip addresses showing through here (which appear to be in the GCE space?) are worrying.
It seems it still failing. I've run it locally and it failed with the following error: The aforementioned line: I think it is expected that there are some pods started by k8s (e.g. elasticsearch). Does it mean the test has a bug?
Strangely the same code () passes tests on travis (https://travis-)
I think you're reading it backwards. The test is expecting no pods to be started, but finding the k8s add-on pods, which is normal if it were running against a normal master. In Travis, it's a synthetic environment with no add-ons. This should be assigned to whoever the checks (on mobile.. I know I merged the PR but don't remember who :)). We need to exclude the add-ons (perhaps by finally getting around to putting them in a separate namespace).
the assertions, so CC'ing for comment.
I looked into this with and it seems that test- may fail locally depending on the kubeconfig. Some commands are using defaults for kubectl and thus sometimes they contact another cluster. I'll send a PR to fix this.

Discussion:
readonly green=$(tput setaf 2) kube::test::clear_all() { <del> kubectl delete rc,pods --all </del> <ins> kubectl delete "${kube_flags[@]}" rc,pods --all </ins> } kube::test::get_object_assert() {

local request=$2 local expected=$3 <del> res=$(kubectl get $object -o template -t "$request") </del> <ins> res=$(kubectl get "${kube_flags[@]}" $object -o template -t "$request") </ins> if [[ "$res" =~ ^$expected$ ]]; then echo -n ${green}

) [ "$(kubectl get minions -t $'{{ .apiVersion }}' "${kube_flags[@]}")" == "${version}" ] fi <ins> id_field="id" labels_field="labels" service_selector_field="selector" rc_replicas_field="desiredState.replicas" if [ "$version" = "v1beta3" ]; then id_field="metadata.name" labels_field="metadata.labels" service_selector_field="spec.selector" rc_replicas_field="spec.replicas" fi </ins> # passing no arguments to create is an error ! kubectl create

### Create POD valid-pod from JSON # Pre-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command <del> kubectl create -f examples/limitrange/valid-pod.json "${kube_flags[@]}" </del> <ins> kubectl create "${kube_flags[@]}" -f examples/limitrange/valid-pod.json </ins> # Post-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' kube::test::get_object_assert 'pod valid-pod' '{{.id}}' 'valid-pod' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' kube::test::get_object_assert 'pod valid-pod' "{{.$id_field}}" 'valid-pod' </ins> ### Dump current valid-pod POD output_pod=$(kubectl get pod valid-pod -o yaml --output-version=v1beta1 "${kube_flags[@]}") ### Delete POD valid-pod by id # Pre-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> # Command kubectl delete pod valid-pod "${kube_flags[@]}" # Post-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> ### Create POD valid-pod from dumped YAML # Pre-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command echo "${output_pod}" | kubectl create -f - "${kube_flags[@]}" # Post-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> ### Delete POD valid-pod from JSON # Pre-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> # Command kubectl delete -f examples/limitrange/valid-pod.json "${kube_flags[@]}" # Post-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> ### Create POD redis-master from JSON # Pre-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command kubectl create -f examples/limitrange/valid-pod.json "${kube_flags[@]}" # Post-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> ### Delete POD valid-pod with label # Pre-condition: valid-pod POD is running <del> kube::test::get_object_assert 'pods -l name=valid-pod' '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert 'pods -l name=valid-pod' "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> # Command kubectl delete pods -l name=valid-pod "${kube_flags[@]}" # Post-condition: no POD is running <del> kube::test::get_object_assert 'pods -l name=valid-pod' '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert 'pods -l name=valid-pod' "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> ### Create POD valid-pod from JSON # Pre-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command kubectl create -f examples/limitrange/valid-pod.json "${kube_flags[@]}" # Post-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> ### Delete PODs with no parameter mustn't kill everything # Pre-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> # Command ! kubectl delete pods "${kube_flags[@]}" # Post-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> ### Delete PODs with --all and a label selector is not permitted # Pre-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> # Command ! kubectl delete --all pods -l name=valid-pod "${kube_flags[@]}" # Post-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> ### Delete all PODs # Pre-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> # Command kubectl delete --all pods "${kube_flags[@]}" # --all remove all the pods # Post-condition: no POD is running <del> kube::test::get_object_assert 'pods -l name=valid-pod' '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert 'pods -l name=valid-pod' "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> ### Create two PODs # Pre-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command kubectl create -f examples/limitrange/valid-pod.json "${kube_flags[@]}" kubectl create -f examples/redis/redis-proxy.yaml "${kube_flags[@]}" # Post-condition: valid-pod and redis-proxy PODs are running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'redis-proxy:valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'redis-proxy:valid-pod:' </ins> ### Delete multiple PODs at once # Pre-condition: valid-pod and redis-proxy PODs are running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'redis-proxy:valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'redis-proxy:valid-pod:' </ins> # Command kubectl delete pods valid-pod redis-proxy "${kube_flags[@]}" # delete multiple pods at once # Post-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> ### Create two PODs # Pre-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command kubectl create -f examples/limitrange/valid-pod.json "${kube_flags[@]}" kubectl create -f examples/redis/redis-proxy.yaml "${kube_flags[@]}" # Post-condition: valid-pod and redis-proxy PODs are running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'redis-proxy:valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'redis-proxy:valid-pod:' </ins> ### Stop multiple PODs at once # Pre-condition: valid-pod and redis-proxy PODs are running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'redis-proxy:valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'redis-proxy:valid-pod:' </ins> # Command kubectl stop pods valid-pod redis-proxy "${kube_flags[@]}" # stop multiple pods at once # Post-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> ### Create valid-pod POD # Pre-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command kubectl create -f examples/limitrange/valid-pod.json "${kube_flags[@]}" # Post-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> ### Label the valid-pod POD # Pre-condition: valid-pod is not labelled <del> kube::test::get_object_assert 'pod valid-pod' '{{range.labels}}{{.}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert 'pod valid-pod' "{{range.$labels_field}}{{.}}:{{end}}" 'valid-pod:' </ins> # Command kubectl label pods valid-pod new-name=new-valid-pod "${kube_flags[@]}" # Post-conditon: valid-pod is labelled <del> kube::test::get_object_assert 'pod valid-pod' '{{range.labels}}{{.}}:{{end}}' 'valid-pod:new-valid-pod:' </del> <ins> kube::test::get_object_assert 'pod valid-pod' "{{range.$labels_field}}{{.}}:{{end}}" 'valid-pod:new-valid-pod:' </ins> ### Delete POD by label # Pre-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> # Command kubectl delete pods -lnew-name=new-valid-pod "${kube_flags[@]}" # Post-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> ### Create valid-pod POD # Pre-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command kubectl create -f examples/limitrange/valid-pod.json "${kube_flags[@]}" # Post-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> ### Overwriting an existing label is not permitted # Pre-condition: name is valid-pod <del> kube::test::get_object_assert 'pod valid-pod' '{{.labels.name}}' 'valid-pod' </del> <ins> kube::test::get_object_assert 'pod valid-pod' "{{.${labels_field}.name}}" 'valid-pod' </ins> # Command ! kubectl label pods valid-pod name=valid-pod-super-sayan "${kube_flags[@]}" # Post-condition: name is still valid-pod <del> kube::test::get_object_assert 'pod valid-pod' '{{.labels.name}}' 'valid-pod' </del> <ins> kube::test::get_object_assert 'pod valid-pod' "{{.${labels_field}.name}}" 'valid-pod' </ins> ### --overwrite must be used to overwrite existing label # Pre-condition: name is valid-pod <del> kube::test::get_object_assert 'pod valid-pod' '{{.labels.name}}' 'valid-pod' </del> <ins> kube::test::get_object_assert 'pod valid-pod' "{{.${labels_field}.name}}" 'valid-pod' </ins> # Command kubectl label --overwrite pods valid-pod name=valid-pod-super-sayan "${kube_flags[@]}" # Post-condition: name is valid-pod-super-sayan <del> kube::test::get_object_assert 'pod valid-pod' '{{.labels.name}}' 'valid-pod-super-sayan' </del> <ins> kube::test::get_object_assert 'pod valid-pod' "{{.${labels_field}.name}}" 'valid-pod-super-sayan' </ins> ### Delete POD by label # Pre-condition: valid-pod POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> # Command kubectl delete pods -lname=valid-pod-super-sayan "${kube_flags[@]}" # Post-condition: no POD is running <del> kube::test::get_object_assert pods '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert pods "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> ##############

### Create POD valid-pod in specific namespace # Pre-condition: no POD is running <del> kube::test::get_object_assert 'pods --namespace=other' '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command kubectl create "${kube_flags[@]}" --namespace=other -f examples/limitrange/valid-pod.json # Post-condition: valid-pod POD is running <del> kube::test::get_object_assert 'pods --namespace=other' '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> ### Delete POD valid-pod in specific namespace # Pre-condition: valid-pod POD is running <del> kube::test::get_object_assert 'pods --namespace=other' '{{range.items}}{{.id}}:{{end}}' 'valid-pod:' </del> <ins> kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{.$id_field}}:{{end}}" 'valid-pod:' </ins> # Command kubectl delete "${kube_flags[@]}" pod --namespace=other valid-pod # Post-condition: no POD is running <del> kube::test::get_object_assert 'pods --namespace=other' '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> ############

### Create redis-master service from JSON # Pre-condition: Only the default kubernetes services are running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:' </ins> # Command kubectl create -f examples/guestbook/redis-master-service.json "${kube_flags[@]}" # Post-condition: redis-master service is running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:redis-master:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:' </ins> ### Dump current redis-master service output_service=$(kubectl get service redis-master -o json --output-version=v1beta3 "${kube_flags[@]}") ### Delete redis-master-service by id # Pre-condition: redis-master service is running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:redis-master:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:' </ins> # Command kubectl delete service redis-master "${kube_flags[@]}" # Post-condition: Only the default kubernetes services are running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:' </ins> ### Create redis-master-service from dumped JSON # Pre-condition: Only the default kubernetes services are running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:' </ins> # Command echo "${output_service}" | kubectl create -f - "${kube_flags[@]}" # Post-condition: redis-master service is running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:redis-master:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:' </ins> ### Create redis-master-${version}-test service # Pre-condition: redis-master-service service is running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:redis-master:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:' </ins> # Command kubectl create -f - "${kube_flags[@]}" << __EOF__ {

} __EOF__ # Post-condition:redis-master-service service is running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:redis-master:service-.*-test:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:service-.*-test:' </ins> # Command kubectl update service "${kube_flags[@]}" service-${version}-test --patch="{"selector":{"my":"test-label"},"apiVersion":"v1beta1"}" # Post-condition: selector.version == ${version} # This test works only in v1beta1 and v1beta2 # https://github.com/GoogleCloudPlatform/kubernetes/issues/4771 <del> kube::test::get_object_assert "service service-${version}-test" "{{range.selector}}{{.}}{{end}}" "test-label" </del> <ins> kube::test::get_object_assert "service service-${version}-test" "{{range.$service_selector_field}}{{.}}{{end}}" "test-label" </ins> ### Identity kubectl get service "${kube_flags[@]}" service-${version}-test -o json | kubectl update "${kube_flags[@]}" -f - ### Delete services by id # Pre-condition: redis-master-service service is running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:redis-master:service-.*-test:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:service-.*-test:' </ins> # Command kubectl delete service redis-master "${kube_flags[@]}" kubectl delete service "service-${version}-test" "${kube_flags[@]}" # Post-condition: Only the default kubernetes services are running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:' </ins> ### Create two services # Pre-condition: Only the default kubernetes services are running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:' </ins> # Command kubectl create -f examples/guestbook/redis-master-service.json "${kube_flags[@]}" kubectl create -f examples/guestbook/redis-slave-service.json "${kube_flags[@]}" # Post-condition: redis-master and redis-slave services are running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:redis-master:redisslave:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:redisslave:' </ins> ### Delete multiple services at once # Pre-condition: redis-master and redis-slave services are running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:redis-master:redisslave:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:redisslave:' </ins> # Command kubectl delete services redis-master redisslave "${kube_flags[@]}" # delete multiple services at once # Post-condition: Only the default kubernetes services are running <del> kube::test::get_object_assert services '{{range.items}}{{.id}}:{{end}}' 'kubernetes:kubernetes-ro:' </del> <ins> kube::test::get_object_assert services "{{range.items}}{{.$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:' </ins> ###########################

### Create replication controller frontend from JSON # Pre-condition: no replication controller is running <del> kube::test::get_object_assert rc "{{range.items}}{{.id}}:{{end}}" '' </del> <ins> kube::test::get_object_assert rc "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command kubectl create -f examples/guestbook/frontend-controller.json "${kube_flags[@]}" # Post-condition: frontend replication controller is running <del> kube::test::get_object_assert rc "{{range.items}}{{.id}}:{{end}}" 'frontend-controller:' </del> <ins> kube::test::get_object_assert rc "{{range.items}}{{.$id_field}}:{{end}}" 'frontend-controller:' </ins> ### Resize replication controller frontend with current-replicas and replicas # Pre-condition: 3 replicas <del> kube::test::get_object_assert 'rc frontend-controller' '{{.desiredState.replicas}}' '3' </del> <ins> kube::test::get_object_assert 'rc frontend-controller' "{{.$rc_replicas_field}}" '3' </ins> # Command kubectl resize --current-replicas=3 --replicas=2 replicationcontrollers frontend-controller "${kube_flags[@]}" # Post-condition: 2 replicas <del> kube::test::get_object_assert 'rc frontend-controller' '{{.desiredState.replicas}}' '2' </del> <ins> kube::test::get_object_assert 'rc frontend-controller' "{{.$rc_replicas_field}}" '2' </ins> ### Resize replication controller frontend with (wrong) current-replicas and replicas # Pre-condition: 2 replicas <del> kube::test::get_object_assert 'rc frontend-controller' '{{.desiredState.replicas}}' '2' </del> <ins> kube::test::get_object_assert 'rc frontend-controller' "{{.$rc_replicas_field}}" '2' </ins> # Command ! kubectl resize --current-replicas=3 --replicas=2 replicationcontrollers frontend-controller "${kube_flags[@]}" # Post-condition: nothing changed <del> kube::test::get_object_assert 'rc frontend-controller' '{{.desiredState.replicas}}' '2' </del> <ins> kube::test::get_object_assert 'rc frontend-controller' "{{.$rc_replicas_field}}" '2' </ins> ### Resize replication controller frontend with replicas only # Pre-condition: 2 replicas <del> kube::test::get_object_assert 'rc frontend-controller' '{{.desiredState.replicas}}' '2' </del> <ins> kube::test::get_object_assert 'rc frontend-controller' "{{.$rc_replicas_field}}" '2' </ins> # Command kubectl resize  --replicas=3 replicationcontrollers frontend-controller "${kube_flags[@]}" # Post-condition: 3 replicas <del> kube::test::get_object_assert 'rc frontend-controller' '{{.desiredState.replicas}}' '3' </del> <ins> kube::test::get_object_assert 'rc frontend-controller' "{{.$rc_replicas_field}}" '3' </ins> ### Delete replication controller with id # Pre-condition: frontend replication controller is running <del> kube::test::get_object_assert rc '{{range.items}}{{.id}}:{{end}}' 'frontend-controller:' </del> <ins> kube::test::get_object_assert rc "{{range.items}}{{.$id_field}}:{{end}}" 'frontend-controller:' </ins> # Command kubectl delete rc frontend-controller "${kube_flags[@]}" # Post-condition: no replication controller is running <del> kube::test::get_object_assert rc '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert rc "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> ### Create two replication controllers # Pre-condition: no replication controller is running <del> kube::test::get_object_assert rc '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert rc "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> # Command kubectl create -f examples/guestbook/frontend-controller.json "${kube_flags[@]}" kubectl create -f examples/guestbook/redis-slave-controller.json "${kube_flags[@]}" # Post-condition: frontend and redis-slave <del> kube::test::get_object_assert rc '{{range.items}}{{.id}}:{{end}}' 'frontend-controller:redis-slave-controller:' </del> <ins> kube::test::get_object_assert rc "{{range.items}}{{.$id_field}}:{{end}}" 'frontend-controller:redis-slave-controller:' </ins> ### Delete multiple controllers at once # Pre-condition: frontend and redis-slave <del> kube::test::get_object_assert rc '{{range.items}}{{.id}}:{{end}}' 'frontend-controller:redis-slave-controller:' </del> <ins> kube::test::get_object_assert rc "{{range.items}}{{.$id_field}}:{{end}}" 'frontend-controller:redis-slave-controller:' </ins> # Command kubectl delete rc frontend-controller redis-slave-controller "${kube_flags[@]}" # delete multiple controllers at once # Post-condition: no replication controller is running <del> kube::test::get_object_assert rc '{{range.items}}{{.id}}:{{end}}' '' </del> <ins> kube::test::get_object_assert rc "{{range.items}}{{.$id_field}}:{{end}}" '' </ins> #########

kube::log::status "Testing kubectl(${version}:nodes)" <del> kube::test::get_object_assert nodes '{{range.items}}{{.id}}:{{end}}' '127.0.0.1:' </del> <ins> kube::test::get_object_assert nodes "{{range.items}}{{.$id_field}}:{{end}}" '127.0.0.1:' </ins> ########### # Minions #

if [[ "${version}" != "v1beta3" ]]; then kube::log::status "Testing kubectl(${version}:minions)" <del> kube::test::get_object_assert minions '{{range.items}}{{.id}}:{{end}}' '127.0.0.1:' </del> <ins> kube::test::get_object_assert minions "{{range.items}}{{.$id_field}}:{{end}}" '127.0.0.1:' </ins> # TODO: I should be a MinionList instead of List kube::test::get_object_assert minions '{{.kind}}' 'List'