]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
sync-pull: Check the actual repo readiness 2550/head
authorDavid Galloway <david.galloway@ibm.com>
Thu, 12 Mar 2026 22:44:35 +0000 (18:44 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Thu, 12 Mar 2026 23:06:15 +0000 (19:06 -0400)
This has been broken for.. possibly ever.

--head results in 405 Method Not Allowed

Just a GET results in 200 no matter what, whether the repo exists or not.

```
++ curl -fsSo - --connect-timeout 5 --max-time 10 https://shaman.ceph.com/api/repos/ceph/reef/efac5a54607c13fa50d4822e50242b86e6e446df/rocky/10/flavors/default/
++ jq -r '.[].status // empty'
+ status=
+ '[' '' = ready ']'
+ echo 'Shaman repo for rocky/10 is not ready (status: unknown). Skipping.'
Shaman repo for rocky/10 is not ready (status: unknown). Skipping.
```

Signed-off-by: David Galloway <david.galloway@ibm.com>
scripts/sync-pull

index c805cea4c5e7c81721b240d57c966251bdfe67a7..42ffe22ace6c587cd96fdce2ca60ba556bd37888 100755 (executable)
@@ -70,12 +70,16 @@ fi
 
 for el_version in centos/9 rocky/10; do
   echo "--------------------------------------------"
-  if curl -fs --head --connect-timeout 5 --max-time 10 https://shaman.ceph.com/api/repos/$project/$release/$sha1/$el_version/flavors/default/ >/dev/null 2>&1; then
+
+  # "//" in jq land is OR.  "empty" is a jq magic variable that returns nothing.
+  status=$(curl -fsSo - --connect-timeout 5 --max-time 10 "https://shaman.ceph.com/api/repos/$project/$release/$sha1/$el_version/flavors/default/" | jq -r '.[].status // empty')
+
+  if [ "$status" = "ready" ]; then
     el_cmd="ubuntu@chacra.ceph.com:/opt/repos/$project/$release/$sha1/$el_version/flavors/default/* /opt/repos/$project/$relver/$el_version/"
-    echo $el_cmd
+    echo "$el_cmd"
     rsync -Lavh --progress $el_cmd
   else
-    echo "Shaman thinks a repo for $el_version doesn't exist.  Skipping."
+    echo "Shaman repo for $el_version is not ready (status: ${status:-unknown}). Skipping."
   fi
 done