mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Merge pull request #105637 from Namanl2001/ssh
adding `--ssh-key` and `--ssh-user` for kubetest2
This commit is contained in:
commit
7c715dbc68
@ -254,6 +254,7 @@ define TEST_E2E_NODE_HELP_INFO
|
||||
# GUBERNATOR: For REMOTE=true only. Produce link to Gubernator to view logs.
|
||||
# Defaults to false.
|
||||
# TEST_SUITE: For REMOTE=true only. Test suite to use. Defaults to "default".
|
||||
# SSH_KEY: For REMOTE=true only. Path to SSH key to use.
|
||||
#
|
||||
# Example:
|
||||
# make test-e2e-node FOCUS=Kubelet SKIP=container
|
||||
|
@ -47,6 +47,8 @@ timeout_arg=""
|
||||
system_spec_name=${SYSTEM_SPEC_NAME:-}
|
||||
extra_envs=${EXTRA_ENVS:-}
|
||||
runtime_config=${RUNTIME_CONFIG:-}
|
||||
ssh_user=${SSH_USER:-"${USER}"}
|
||||
ssh_key=${SSH_KEY:-}
|
||||
|
||||
# Parse the flags to pass to ginkgo
|
||||
ginkgoflags=""
|
||||
@ -170,6 +172,7 @@ if [ "${remote}" = true ] ; then
|
||||
--delete-instances="${delete_instances}" --test_args="${test_args}" --instance-metadata="${metadata}" \
|
||||
--image-config-file="${image_config_file}" --system-spec-name="${system_spec_name}" \
|
||||
--runtime-config="${runtime_config}" --preemptible-instances="${preemptible_instances}" \
|
||||
--ssh-user="${ssh_user}" --ssh-key="${ssh_key}" \
|
||||
--extra-envs="${extra_envs}" --test-suite="${test_suite}" \
|
||||
"${timeout_arg}" \
|
||||
2>&1 | tee -i "${artifacts}/build-log.txt"
|
||||
|
@ -44,8 +44,12 @@ func init() {
|
||||
sshOptionsMap = map[string]string{
|
||||
"gce": "-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o CheckHostIP=no -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o LogLevel=ERROR",
|
||||
}
|
||||
defaultGceKey := os.Getenv("GCE_SSH_PRIVATE_KEY_FILE")
|
||||
if defaultGceKey == "" {
|
||||
defaultGceKey = fmt.Sprintf("%s/.ssh/google_compute_engine", usr.HomeDir)
|
||||
}
|
||||
sshDefaultKeyMap = map[string]string{
|
||||
"gce": fmt.Sprintf("%s/.ssh/google_compute_engine", usr.HomeDir),
|
||||
"gce": defaultGceKey,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user