1
0
Fork 0
mirror of https://github.com/imjasonh/git-k8s synced 2026-07-11 16:09:40 +00:00

Improve e2e Gitea initialization robustness

- Add explicit API readiness check inside the pod before running
  admin commands (readiness probe alone may pass before DB is ready)
- Split "Initialize Gitea" into separate steps for better failure
  diagnostics: "Create Gitea admin user" and "Create test repository"

https://claude.ai/code/session_01QfFzqKQUsxxBsiZUhuJ3pG
This commit is contained in:
Claude 2026-02-28 01:27:31 +00:00
parent 6db30c9fe3
commit de30422c67
No known key found for this signature in database

View file

@ -153,11 +153,22 @@ jobs:
EOF
- name: Wait for Gitea
run: kubectl rollout status deployment/gitea -n git-system --timeout=120s
- name: Initialize Gitea
run: |
# Create admin user.
kubectl rollout status deployment/gitea -n git-system --timeout=120s
# Wait for Gitea API to be fully responsive inside the pod.
for i in $(seq 1 30); do
if kubectl exec -n git-system deploy/gitea -- \
curl -sf http://localhost:3000/api/v1/version; then
echo ""
echo "Gitea API is ready"
break
fi
echo "Waiting for Gitea API (attempt $i)..."
sleep 2
done
- name: Create Gitea admin user
run: |
kubectl exec -n git-system deploy/gitea -- \
gitea admin user create \
--admin \
@ -166,7 +177,8 @@ jobs:
--email admin@test.local \
--must-change-password=false
# Create test repository with an initial commit on main.
- name: Create test repository
run: |
kubectl exec -n git-system deploy/gitea -- \
curl -sf -X POST http://localhost:3000/api/v1/user/repos \
-H 'Content-Type: application/json' \