Skip to content

Commit 4c5e177

Browse files
committed
fix
1 parent 611cbfe commit 4c5e177

File tree

1 file changed

+37
-44
lines changed

1 file changed

+37
-44
lines changed

.github/workflows/generic_kubernetes_migration_from_bitnami_test.yml

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -656,53 +656,46 @@ jobs:
656656
export CAMUNDA_NAMESPACE="${{ env.CAMUNDA_NAMESPACE }}"
657657
export CAMUNDA_RELEASE_NAME="camunda"
658658
659-
# Run the validation script (still in migration-from-bitnami for now)
660-
if [[ -f ./generic/kubernetes/migration-from-bitnami/shared/test-data/validate-test-data.sh ]]; then
661-
./generic/kubernetes/migration-from-bitnami/shared/test-data/validate-test-data.sh
662-
else
663-
echo "Test data validation script not found — running inline checks"
664-
665-
# Quick inline validation: check ES indices exist and PG tables present
666-
ES_POD=$(kubectl get pods -n "${CAMUNDA_NAMESPACE}" \
667-
-l "elasticsearch.k8s.elastic.co/cluster-name" \
668-
-o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "")
669-
670-
if [[ -n "$ES_POD" ]]; then
671-
ES_PWD=$(kubectl get secret elasticsearch-es-elastic-user -n "${CAMUNDA_NAMESPACE}" \
672-
-o jsonpath='{.data.elastic}' 2>/dev/null | base64 -d || echo "")
673-
INDICES=$(kubectl exec -n "${CAMUNDA_NAMESPACE}" "$ES_POD" -- \
674-
curl -sf -u "elastic:${ES_PWD}" "localhost:9200/_cat/indices?h=index" 2>/dev/null || echo "")
675-
echo "ECK Elasticsearch indices after migration:"
676-
echo "$INDICES"
677-
678-
if echo "$INDICES" | grep -qE "(operate|tasklist|zeebe)"; then
679-
echo "✓ Camunda indices found in ECK Elasticsearch"
680-
else
681-
echo "⚠ No Camunda indices detected — data may not have migrated"
682-
fi
683-
fi
659+
# Quick validation: check ES indices exist and PG tables present
660+
ES_POD=$(kubectl get pods -n "${CAMUNDA_NAMESPACE}" \
661+
-l "elasticsearch.k8s.elastic.co/cluster-name" \
662+
-o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "")
684663
685-
# Check CNPG clusters have tables
686-
for CLUSTER in pg-identity pg-keycloak pg-webmodeler; do
687-
SECRET="${CLUSTER}-secret"
688-
if kubectl get secret "$SECRET" -n "${CAMUNDA_NAMESPACE}" &>/dev/null; then
689-
PASSWORD=$(kubectl get secret "$SECRET" -n "${CAMUNDA_NAMESPACE}" \
690-
-o jsonpath='{.data.password}' | base64 -d)
691-
USER=$(kubectl get secret "$SECRET" -n "${CAMUNDA_NAMESPACE}" \
692-
-o jsonpath='{.data.username}' | base64 -d)
693-
DB=$(kubectl get secret "$SECRET" -n "${CAMUNDA_NAMESPACE}" \
694-
-o jsonpath='{.data.dbname}' | base64 -d 2>/dev/null || echo "${CLUSTER#pg-}")
695-
696-
TABLE_COUNT=$(kubectl run "pg-check-${CLUSTER}-${RANDOM}" --rm -i --restart=Never \
697-
--image=postgres:15-alpine -n "${CAMUNDA_NAMESPACE}" -- \
698-
psql "postgresql://${USER}:${PASSWORD}@${CLUSTER}-rw:5432/${DB}" \
699-
-tAc "SELECT count(*) FROM information_schema.tables WHERE table_schema='public'" \
700-
2>/dev/null || echo "0")
701-
echo "${CLUSTER}: ${TABLE_COUNT} tables in public schema"
702-
fi
703-
done
664+
if [[ -n "$ES_POD" ]]; then
665+
ES_PWD=$(kubectl get secret elasticsearch-es-elastic-user -n "${CAMUNDA_NAMESPACE}" \
666+
-o jsonpath='{.data.elastic}' 2>/dev/null | base64 -d || echo "")
667+
INDICES=$(kubectl exec -n "${CAMUNDA_NAMESPACE}" "$ES_POD" -- \
668+
curl -sf -u "elastic:${ES_PWD}" "localhost:9200/_cat/indices?h=index" 2>/dev/null || echo "")
669+
echo "ECK Elasticsearch indices after migration:"
670+
echo "$INDICES"
671+
672+
if echo "$INDICES" | grep -qE "(operate|tasklist|zeebe)"; then
673+
echo "✓ Camunda indices found in ECK Elasticsearch"
674+
else
675+
echo "⚠ No Camunda indices detected — data may not have migrated"
676+
fi
704677
fi
705678
679+
# Check CNPG clusters have tables
680+
for CLUSTER in pg-identity pg-keycloak pg-webmodeler; do
681+
SECRET="${CLUSTER}-secret"
682+
if kubectl get secret "$SECRET" -n "${CAMUNDA_NAMESPACE}" &>/dev/null; then
683+
PASSWORD=$(kubectl get secret "$SECRET" -n "${CAMUNDA_NAMESPACE}" \
684+
-o jsonpath='{.data.password}' | base64 -d)
685+
USER=$(kubectl get secret "$SECRET" -n "${CAMUNDA_NAMESPACE}" \
686+
-o jsonpath='{.data.username}' | base64 -d)
687+
DB=$(kubectl get secret "$SECRET" -n "${CAMUNDA_NAMESPACE}" \
688+
-o jsonpath='{.data.dbname}' | base64 -d 2>/dev/null || echo "${CLUSTER#pg-}")
689+
690+
TABLE_COUNT=$(kubectl run "pg-check-${CLUSTER}-${RANDOM}" --rm -i --restart=Never \
691+
--image=postgres:15-alpine -n "${CAMUNDA_NAMESPACE}" -- \
692+
psql "postgresql://${USER}:${PASSWORD}@${CLUSTER}-rw:5432/${DB}" \
693+
-tAc "SELECT count(*) FROM information_schema.tables WHERE table_schema='public'" \
694+
2>/dev/null || echo "0")
695+
echo "${CLUSTER}: ${TABLE_COUNT} tables in public schema"
696+
fi
697+
done
698+
706699
echo "✓ Test data validation completed"
707700
708701
- name: Get failed Pods info

0 commit comments

Comments
 (0)