Skip to content

Commit 43f6852

Browse files
committed
Test commit to get more insights on the failing aws e2e test
1 parent c4113c7 commit 43f6852

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ e2e-helm-deploy:
431431
--set tokenRequests[0].audience="aud1" \
432432
--set tokenRequests[1].audience="aud2" \
433433
--set tokenRequests[2].audience="conjur" \
434-
--set tokenRequests[3].audience="api://AzureADTokenExchange"
434+
--set tokenRequests[3].audience="api://AzureADTokenExchange" \
435+
--set tokenRequests[4].audience="sts.amazonaws.com"
435436

436437
.PHONY: e2e-helm-upgrade
437438
e2e-helm-upgrade:

test/bats/aws.bats

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,22 @@ teardown_file() {
7070

7171
@test "CSI inline volume test with pod portability" {
7272
kubectl --namespace $NAMESPACE apply -f $BATS_TEST_DIR/BasicTestMount.yaml
73-
kubectl --namespace $NAMESPACE wait --for=condition=Ready --timeout=60s pod/basic-test-mount
73+
74+
if ! kubectl --namespace $NAMESPACE wait --for=condition=Ready --timeout=${WAIT_TIME}s pod/basic-test-mount; then
75+
echo "=== Pod failed to become Ready. Dumping diagnostics ===" >&3
76+
echo "--- Pod describe ---" >&3
77+
kubectl --namespace $NAMESPACE describe pod/$POD_NAME >&3 2>&1
78+
echo "--- Pod env (IRSA check) ---" >&3
79+
kubectl --namespace $NAMESPACE get pod/$POD_NAME -o jsonpath='{range .spec.containers[*].env[*]}{.name}={.value}{"\n"}{end}' >&3 2>&1
80+
echo "--- ServiceAccount annotation ---" >&3
81+
kubectl --namespace $NAMESPACE get sa basic-test-mount-sa -o jsonpath='{.metadata.annotations}' >&3 2>&1
82+
echo "" >&3
83+
echo "--- CSI driver logs (last 50 lines) ---" >&3
84+
kubectl -n kube-system logs -l app=secrets-store-csi-driver --tail 50 -c secrets-store >&3 2>&1
85+
echo "--- AWS provider logs (last 50 lines) ---" >&3
86+
kubectl -n kube-system logs -l app=csi-secrets-store-provider-aws --tail 50 >&3 2>&1
87+
return 1
88+
fi
7489

7590
run kubectl --namespace $NAMESPACE get pod/$POD_NAME
7691
assert_success

test/scripts/initialize_eks_cluster.bash

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,27 @@ eksctl create iamserviceaccount \
6767
--approve \
6868
--region $AWS_REGION
6969

70+
71+
echo "Wait 60s after IAM service account creation..."
72+
sleep 60
73+
74+
# Validate IRSA configuration
75+
echo "=== IRSA debug: ServiceAccount annotation ==="
76+
SA_ROLE_ARN=$(kubectl -n $NAMESPACE get sa $AWS_SERVICE_ACCOUNT_NAME -o jsonpath='{.metadata.annotations.eks\.amazonaws\.com/role-arn}' 2>&1)
77+
echo "ServiceAccount role-arn: $SA_ROLE_ARN"
78+
if [ -z "$SA_ROLE_ARN" ]; then
79+
echo "ERROR: ServiceAccount $AWS_SERVICE_ACCOUNT_NAME is missing eks.amazonaws.com/role-arn annotation"
80+
kubectl -n $NAMESPACE get sa $AWS_SERVICE_ACCOUNT_NAME -o yaml
81+
fi
82+
83+
echo "=== IRSA debug: IAM role trust policy ==="
84+
ROLE_NAME=$(echo "$SA_ROLE_ARN" | awk -F'/' '{print $NF}')
85+
aws iam get-role --role-name "$ROLE_NAME" --query 'Role.AssumeRolePolicyDocument' --output json --region $AWS_REGION 2>&1 || echo "WARNING: Could not fetch IAM role trust policy"
86+
87+
echo "=== IRSA Diagnostic: OIDC provider ==="
88+
OIDC_URL=$(aws eks describe-cluster --name $EKS_CLUSTER_NAME --region $AWS_REGION --query 'cluster.identity.oidc.issuer' --output text 2>&1)
89+
echo "Cluster OIDC issuer: $OIDC_URL"
90+
7091
# on a release test the caller will perform the driver installation
7192
if [ -z "$RELEASE" ]; then
7293
REGISTRY=$ECR_REGISTRY_URL make e2e-helm-deploy

0 commit comments

Comments
 (0)