Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not run kubelet in test-cmd.sh #41843

Merged
merged 1 commit into from
Feb 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 3 additions & 46 deletions hack/make-rules/test-cmd.sh
Expand Up @@ -68,51 +68,10 @@ function run_kube_controller_manager() {
kube::util::wait_for_url "http://127.0.0.1:${CTLRMGR_PORT}/healthz" "controller-manager"
}

function run_kubelet() {
# Only run kubelet on platforms it supports
if [[ "$(go env GOHOSTOS)" == "linux" ]]; then
kube::log::status "Building kubelet"
make -C "${KUBE_ROOT}" WHAT="cmd/kubelet"

kube::log::status "Starting kubelet in masterless mode"
"${KUBE_OUTPUT_HOSTBIN}/kubelet" \
--really-crash-for-testing=true \
--root-dir=/tmp/kubelet.$$ \
--cert-dir="${TMPDIR:-/tmp/}" \
--docker-endpoint="fake://" \
--hostname-override="127.0.0.1" \
--address="127.0.0.1" \
--port="$KUBELET_PORT" \
--healthz-port="${KUBELET_HEALTHZ_PORT}" 1>&2 &
KUBELET_PID=$!
kube::util::wait_for_url "http://127.0.0.1:${KUBELET_HEALTHZ_PORT}/healthz" "kubelet(masterless)"
kill ${KUBELET_PID} 1>&2 2>/dev/null

kube::log::status "Starting kubelet in masterful mode"
"${KUBE_OUTPUT_HOSTBIN}/kubelet" \
--really-crash-for-testing=true \
--root-dir=/tmp/kubelet.$$ \
--cert-dir="${TMPDIR:-/tmp/}" \
--docker-endpoint="fake://" \
--hostname-override="127.0.0.1" \
--address="127.0.0.1" \
--api-servers="${API_HOST}:${API_PORT}" \
--port="$KUBELET_PORT" \
--healthz-port="${KUBELET_HEALTHZ_PORT}" 1>&2 &
KUBELET_PID=$!

kube::util::wait_for_url "http://127.0.0.1:${KUBELET_HEALTHZ_PORT}/healthz" "kubelet"
fi
}

# Creates a node object with name 127.0.0.1 if it doesnt exist already.
# This is required for non-linux platforms where we do not run kubelet.
# Creates a node object with name 127.0.0.1. This is required because we do not
# run kubelet.
function create_node() {
if [[ "$(go env GOHOSTOS)" == "linux" ]]; then
kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/api/v1/nodes/127.0.0.1" "apiserver(nodes)"
else
# create a fake node
kubectl create -f - -s "http://127.0.0.1:${API_PORT}" << __EOF__
kubectl create -f - -s "http://127.0.0.1:${API_PORT}" << __EOF__
{
"kind": "Node",
"apiVersion": "v1",
Expand All @@ -126,15 +85,13 @@ function create_node() {
}
}
__EOF__
fi
}

kube::log::status "Running kubectl tests for kube-apiserver"

setup
run_kube_apiserver
run_kube_controller_manager
run_kubelet
create_node
SUPPORTED_RESOURCES=("*")
# WARNING: Do not wrap this call in a subshell to capture output, e.g. output=$(runTests)
Expand Down