Merge pull request #52360 from shyamjvs/add-debug-statements

Automatic merge from submit-queue (batch tested with PRs 52339, 52343, 52125, 52360, 52301)

Make log-dump use 'gcloud ssh' for GKE also

Fixes https://github.com/kubernetes/test-infra/issues/4323

I tested it locally (with some hacking for mimicking gke's DumpClusterLogs function in kubetest) and it worked.

cc @ericchiang
This commit is contained in:
Kubernetes Submit Queue 2017-09-12 21:45:59 -07:00 committed by GitHub
commit 83c2f358c9

View File

@ -56,9 +56,10 @@ readonly systemd_services="kubelet docker"
# file descriptors for large clusters.
readonly max_scp_processes=25
# TODO: Get rid of all the sourcing of bash dependencies eventually.
function setup() {
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
if [[ -z "${use_custom_instance_list}" ]]; then
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
: ${KUBE_CONFIG_FILE:="config-test.sh"}
echo "Sourcing kube-util.sh"
source "${KUBE_ROOT}/cluster/kube-util.sh"
@ -66,6 +67,8 @@ function setup() {
detect-project 2>&1
elif [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
echo "Using 'use_custom_instance_list' with gke, skipping check for LOG_DUMP_SSH_KEY and LOG_DUMP_SSH_USER"
# Source the below script for the ssh-to-node utility function.
source "${KUBE_ROOT}/cluster/gce/util.sh"
elif [[ -z "${LOG_DUMP_SSH_KEY:-}" ]]; then
echo "LOG_DUMP_SSH_KEY not set, but required when using log_dump_custom_get_instances"
exit 1
@ -76,7 +79,7 @@ function setup() {
}
function log-dump-ssh() {
if [[ -z "${use_custom_instance_list}" ]]; then
if [[ "${gcloud_supported_providers}" =~ "${KUBERNETES_PROVIDER}" ]]; then
ssh-to-node "$@"
return
fi