Transfer only the ~/.kube/config file for k8s tests, since the rest
of contents of the "~/.kube/" directory (e.g. http-cache) might be
owned by root, causing permission issues when Jenkins tries to
perform the workspace cleanup. Since only the config file is actually
needed for running the k8s tests, skip other files/directories in
"~/.kube/"
Signed-off-by: DANIEL STOICA <daniel.stoica@enea.com>
Change-Id: Ic3d6823bd45069e66eb085a8c09383461f517d12
if [[ -n ${ssh_password} ]]
then
sshpass -p "${ssh_password}" scp -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -r\
- "${ssh_user}@${cluster_master_ip}:~/.kube/*" "$k8s_config_dir"
+ "${ssh_user}@${cluster_master_ip}:~/.kube/config" "$k8s_config_dir"
else
scp -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i"$ssh_key" -r\
- "${ssh_user}"@"${cluster_master_ip}":~/.kube/* "$k8s_config_dir"
+ "${ssh_user}"@"${cluster_master_ip}":~/.kube/config "$k8s_config_dir"
fi
fi