You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/sync-db.yml
+53-6Lines changed: 53 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -139,29 +139,48 @@ jobs:
139
139
sleep 15
140
140
141
141
# Find the job created by k8up for this restore
142
-
for i in {1..30}; do
143
-
JOB_NAME=$(kubectl get jobs -n default -l k8up.io/owned-by=restore -o jsonpath='{.items[?(@.metadata.ownerReferences[0].name=="'$RESTORE_NAME'")].metadata.name}' 2>/dev/null)
142
+
# k8up creates jobs with name pattern "restore-<restore-name>"
143
+
# Since our restore is named "restore-from-prod-*", the job will be "restore-restore-from-prod-*"
144
+
for i in {1..60}; do
145
+
JOB_NAME=$(kubectl get jobs -n default --no-headers 2>/dev/null | grep "^restore-$RESTORE_NAME" | awk '{print $1}' | head -1)
144
146
if [ -n "$JOB_NAME" ]; then
145
147
echo "Found restore job: $JOB_NAME"
146
148
break
147
149
fi
148
-
echo "Waiting for job to be created... ($i/30)"
150
+
echo "Waiting for job to be created... ($i/60)"
149
151
sleep 2
150
152
done
151
153
152
154
if [ -z "$JOB_NAME" ]; then
153
-
echo "ERROR: Restore job not found"
154
-
kubectl get restore $RESTORE_NAME -n default -o yaml
155
+
echo "ERROR: Restore job not found after 120 seconds"
156
+
echo "Checking restore resource status:"
157
+
kubectl get restore $RESTORE_NAME -n default
158
+
kubectl describe restore $RESTORE_NAME -n default
159
+
160
+
echo "Checking for any restore jobs:"
161
+
kubectl get jobs -n default | grep restore || echo "No restore jobs found"
0 commit comments