validation:Fix jobs cleanup issue with permissions 07/3407/2
authorDANIEL STOICA <daniel.stoica@enea.com>
Fri, 8 May 2020 13:10:00 +0000 (16:10 +0300)
committerDaniel Stoica <daniel.stoica@enea.com>
Fri, 8 May 2020 13:47:49 +0000 (13:47 +0000)
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

jjb/shell/run_bluval.sh

index 4284610..4b306a8 100755 (executable)
@@ -125,10 +125,10 @@ then
     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