From 40fda813b0c33faa060f44dd2b078b8a8674b793 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Mon, 14 Nov 2016 12:02:27 +0100 Subject: [PATCH] make test-cmd run over hyperkube based kubectl --- src/k8s.io/kubernetes/hack/lib/test.sh | 3 ++- src/k8s.io/kubernetes/hack/make-rules/test-cmd.sh | 14 +------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/hack/lib/test.sh b/hack/lib/test.sh index 00f7ceb..26d9d85 100644 --- a/hack/lib/test.sh +++ b/hack/lib/test.sh @@ -33,8 +33,9 @@ kube::test::get_object_assert() { local request=$2 local expected=$3 local args=${4:-} + local get_args=${5:-} - res=$(eval kubectl ${args} get "${kube_flags[@]}" $object -o go-template=\"$request\") + res=$(eval kubectl ${args} get "${kube_flags[@]}" ${get_args} $object -o go-template=\"$request\") if [[ "$res" =~ ^$expected$ ]]; then echo -n ${green} diff --git a/hack/make-rules/test-cmd.sh b/hack/make-rules/test-cmd.sh index e77b06d..b1cc52e 100755 --- a/hack/make-rules/test-cmd.sh +++ b/hack/make-rules/test-cmd.sh @@ -147,13 +147,6 @@ function wait-for-pods-with-label() kube::util::trap_add cleanup EXIT SIGINT kube::util::ensure-temp-dir -BINS=( - cmd/kubectl - cmd/kube-apiserver - cmd/kube-controller-manager -) -make -C "${KUBE_ROOT}" WHAT="${BINS[*]}" - kube::etcd::start ETCD_HOST=${ETCD_HOST:-127.0.0.1} @@ -190,11 +183,6 @@ kube::log::status "Running kubectl with no options" # Only run kubelet on platforms it supports if [[ "$(go env GOHOSTOS)" == "linux" ]]; then -BINS=( - cmd/kubelet -) -make -C "${KUBE_ROOT}" WHAT="${BINS[*]}" - kube::log::status "Starting kubelet in masterless mode" "${KUBE_OUTPUT_HOSTBIN}/kubelet" \ --really-crash-for-testing=true \ @@ -456,7 +444,7 @@ runTests() { # Describe command should print events information when show-events=true kube::test::describe_resource_events_assert pods true ### Validate Export ### - kube::test::get_object_assert 'pods/valid-pod' "{{.metadata.namespace}} {{.metadata.name}}" ' valid-pod' "--export=true" + kube::test::get_object_assert 'pods/valid-pod' "{{.metadata.namespace}} {{.metadata.name}}" ' valid-pod' "" "--export=true" ### Dump current valid-pod POD output_pod=$(kubectl get pod valid-pod -o yaml --output-version=v1 "${kube_flags[@]}") -- 1.9.3