Skip to content

Commit 39782c8

Browse files
committed
foo
1 parent 908d8a1 commit 39782c8

File tree

4 files changed

+72
-4
lines changed

4 files changed

+72
-4
lines changed

.github/workflows/helm-tests.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,26 @@ jobs:
5252
- name: Set release name
5353
run: echo "RELEASE_NAME=eoapi-$(echo "${{ github.sha }}" | cut -c1-8)" >> "$GITHUB_ENV"
5454

55+
- name: Wait for K3s to be fully ready
56+
run: |
57+
echo "=== Waiting for K3s to be fully ready ==="
58+
59+
# Wait for core K3s components to be ready
60+
echo "Waiting for kube-system pods to be ready..."
61+
kubectl wait --for=condition=Ready pod -l k8s-app=kube-dns -n kube-system --timeout=300s
62+
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=traefik -n kube-system --timeout=300s
63+
64+
# Wait for API server to be fully responsive
65+
echo "Checking API server responsiveness..."
66+
kubectl get nodes
67+
kubectl get pods --all-namespaces
68+
69+
# Give K3s a moment to initialize all CRDs
70+
echo "Waiting for K3s initialization to complete..."
71+
sleep 10
72+
73+
echo "✅ K3s is ready"
74+
5575
- name: Install Knative Serving
5676
run: |
5777
echo "=== Installing Knative Serving ==="
@@ -95,6 +115,45 @@ jobs:
95115
echo "Waiting for CloudEvents sink to be ready..."
96116
kubectl wait --for=condition=Ready ksvc/eoapi-cloudevents-sink -n eoapi --timeout=300s
97117
118+
- name: Wait for Traefik to be ready
119+
run: |
120+
echo "=== Waiting for Traefik to be ready ==="
121+
122+
# Wait for Traefik pods to be ready first
123+
echo "Waiting for Traefik controller to be ready..."
124+
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=traefik -n kube-system --timeout=300s
125+
126+
# Wait for essential Traefik CRDs to be available
127+
echo "Checking for Traefik CRDs..."
128+
timeout=300
129+
counter=0
130+
required_crds=("middlewares.traefik.io" "ingressroutes.traefik.io")
131+
132+
for crd in "${required_crds[@]}"; do
133+
echo "Checking for CRD: $crd"
134+
counter=0
135+
while [ $counter -lt $timeout ]; do
136+
if kubectl get crd "$crd" &>/dev/null; then
137+
echo "✅ $crd is available"
138+
break
139+
fi
140+
echo "⏳ Waiting for $crd... ($counter/$timeout)"
141+
sleep 3
142+
counter=$((counter + 3))
143+
done
144+
145+
if [ $counter -ge $timeout ]; then
146+
echo "❌ Timeout waiting for $crd"
147+
echo "Available Traefik CRDs:"
148+
kubectl get crd | grep traefik || echo "No Traefik CRDs found"
149+
echo "All CRDs:"
150+
kubectl get crd
151+
exit 1
152+
fi
153+
done
154+
155+
echo "✅ All required Traefik CRDs are ready"
156+
98157
- name: Deploy eoAPI
99158
id: deploy
100159
run: |
@@ -130,6 +189,13 @@ jobs:
130189
kubectl get crd | grep knative || echo "No Knative CRDs found"
131190
kubectl get crd sinkbindings.sources.knative.dev || echo "SinkBinding CRD not found"
132191
192+
# Check Traefik status
193+
echo "=== Traefik Status ==="
194+
kubectl get pods -n kube-system -l app.kubernetes.io/name=traefik -o wide || echo "No Traefik pods found"
195+
kubectl get crd | grep traefik || echo "No Traefik CRDs found"
196+
kubectl get crd middlewares.traefik.io || echo "Middleware CRD not found"
197+
kubectl get crd ingressroutes.traefik.io || echo "IngressRoute CRD not found"
198+
133199
# Check notification system final status
134200
echo "=== Notification System Final Status ==="
135201
kubectl get deployments -l app.kubernetes.io/name=eoapi-notifier -o wide || echo "No eoapi-notifier deployment"

charts/eoapi/test-k3s-unittest-values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ eoapi-notifier:
6262
channel: pgstac_items_change
6363
connection:
6464
existingSecret:
65-
name: "eoapi-test-pguser-eoapi"
65+
name: ""
6666
keys:
6767
username: "user"
6868
password: "password"

scripts/deploy.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ deploy_eoapi() {
144144
if [ "$CI_MODE" = true ] && [ -f "./eoapi/test-k3s-unittest-values.yaml" ]; then
145145
log_info "Using CI test configuration..."
146146
HELM_CMD="$HELM_CMD -f ./eoapi/test-k3s-unittest-values.yaml"
147+
# Fix eoapi-notifier secret name dynamically
148+
HELM_CMD="$HELM_CMD --set eoapi-notifier.config.sources[0].config.connection.existingSecret.name=$RELEASE_NAME-pguser-eoapi"
147149
fi
148150

149151
# Set git SHA if available

scripts/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ install_test_deps() {
127127
python_cmd="python3"
128128
fi
129129

130-
if ! $python_cmd -m pip install --quiet pytest httpx >/dev/null 2>&1; then
131-
log_error "Failed to install test dependencies (pytest, httpx)"
132-
log_error "Please install manually: pip install pytest httpx"
130+
if ! $python_cmd -m pip install --quiet pytest httpx psycopg2-binary >/dev/null 2>&1; then
131+
log_error "Failed to install test dependencies (pytest, httpx, psycopg2-binary)"
132+
log_error "Please install manually: pip install pytest httpx psycopg2-binary"
133133
exit 1
134134
fi
135135

0 commit comments

Comments
 (0)