Skip to content

Commit b50eddc

Browse files
Merge pull request #1687 from atlassian/results/improve-results-copying
results/improve-results-copying
2 parents aaaa05d + b71ee53 commit b50eddc

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

app/util/k8s/bzt_on_pod.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ echo "INFO: Copy latest dc-app-performance-toolkit folder to the exec env pod"
5050
start=$(date +%s)
5151
# tar only app folder, exclude results and util/k8s folder
5252
tar -czf dcapt.tar.gz -C dc-app-performance-toolkit --exclude results --exclude util/k8s app Dockerfile requirements.txt
53-
kubectl cp --retries 10 dcapt.tar.gz atlassian/"$exec_pod_name":/dcapt.tar.gz
5453
kubectl exec -it "$exec_pod_name" -n atlassian -- mkdir /dc-app-performance-toolkit
55-
kubectl exec -it "$exec_pod_name" -n atlassian -- tar -xf /dcapt.tar.gz -C /dc-app-performance-toolkit
54+
cat dcapt.tar.gz | kubectl exec -i -n atlassian "$exec_pod_name" -- tar xzf - -C /dc-app-performance-toolkit
5655
rm -rf dcapt.tar.gz
5756
end=$(date +%s)
5857
runtime=$((end-start))
@@ -68,7 +67,7 @@ kubectl exec -it "$exec_pod_name" -n atlassian -- docker run --shm-size=4g -v "/
6867
sleep 10
6968

7069
echo "INFO: Copy results folder from the exec env pod to local"
71-
kubectl cp --retries 10 atlassian/"$exec_pod_name":dc-app-performance-toolkit/app/results dc-app-performance-toolkit/app/results
70+
kubectl exec -n atlassian "$exec_pod_name" -- tar cf - /dc-app-performance-toolkit/app/results | tar xf - -C /dc-app-performance-toolkit/app/results
7271
if [[ $? -ne 0 ]]; then
7372
echo "ERROR: Copy results folder failed"
7473
exit 1

app/util/k8s/copy_run_results.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fi
3030
echo "INFO: Execution environment pod name: $exec_pod_name"
3131

3232
echo "INFO: Copy results folder from the exec env pod to local"
33-
kubectl cp --retries 100 atlassian/"$exec_pod_name":dc-app-performance-toolkit/app/results dc-app-performance-toolkit/app/results
33+
kubectl exec -n atlassian "$exec_pod_name" -- tar cf - /dc-app-performance-toolkit/app/results | tar xf - -C /dc-app-performance-toolkit/app/results
3434
if [[ $? -ne 0 ]]; then
3535
echo "ERROR: Copy results folder failed"
3636
exit 1

0 commit comments

Comments
 (0)