Skip to content

Commit

Permalink
Merge pull request k8up-io#944 from k8up-io/optimize/e2e
Browse files Browse the repository at this point in the history
Replace unrealiable kubectl run --attach
  • Loading branch information
Kidswiss committed Mar 19, 2024
2 parents cd6ceb5 + 60feb80 commit 02185ae
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions e2e/lib/k8up.bash
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ clear_pv_data() {
mkdir -p ./debug/data/pvc-subject
}

# We're not using `kubectl run --attach` here, to get the output of the pod.
# It's very unreliable unfortunately. So running the pod, waiting and getting the
# log output is a lot less prone for race conditions.
restic() {
kubectl run "restic-$(timestamp)" \
--attach \
podname="restic-$(timestamp)"
kubectl run "$podname" \
--restart Never \
--namespace "${DETIK_CLIENT_NAMESPACE-"k8up-system"}" \
--image "${E2E_IMAGE}" \
Expand All @@ -68,7 +71,9 @@ restic() {
--no-cache \
--repo "s3:http://minio.minio.svc.cluster.local:9000/backup" \
"${@}" \
--json
--json > /dev/null
kubectl wait --for jsonpath='{.status.phase}'=Succeeded pod "$podname" -n "${DETIK_CLIENT_NAMESPACE-"k8up-system"}" --timeout=2m > /dev/null
kubectl -n "${DETIK_CLIENT_NAMESPACE-"k8up-system"}" logs "$podname"
}

replace_in_file() {
Expand Down

0 comments on commit 02185ae

Please sign in to comment.