Skip to content

Commit 5ee7321

Browse files
committed
test
Signed-off-by: sk593 <shruthikumar@microsoft.com>
1 parent 4a6b3f7 commit 5ee7321

2 files changed

Lines changed: 47 additions & 9 deletions

File tree

.github/scripts/create-cluster.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ EOF
120120
--create-namespace \
121121
--version 1.3.0 \
122122
--set azureTenantID="${AZURE_TENANT_ID}" \
123-
--wait || echo "Warning: Failed to install Azure Workload Identity webhook. Azure recipes may not work."
123+
--wait || echo "Warning: Failed to install Azure Workload Identity webhook. Azure Recipes may not work."
124124

125125
echo "Waiting for webhook to be fully registered..."
126126
for i in {1..30}; do
@@ -134,7 +134,7 @@ EOF
134134
done
135135
else
136136
echo "Warning: Helm is not installed. Skipping Azure Workload Identity webhook installation."
137-
echo "Azure recipes will not work without this component."
137+
echo "Azure Recipes will not work without this component."
138138
fi
139139
fi
140140

@@ -170,12 +170,19 @@ else
170170
echo "✓ Local registry already running at localhost:5000"
171171
fi
172172

173+
if [[ -z "${AZURE_CLIENT_ID:-}" ]]; then
174+
echo "Error: AZURE_CLIENT_ID must be set to install Radius with Azure Workload Identity."
175+
echo "Ensure the GitHub secret/environment variable is available before running make create-radius-cluster."
176+
exit 1
177+
fi
178+
173179
echo "Installing Radius on Kubernetes..."
174180
rad install kubernetes \
175181
--set rp.publicEndpointOverride=localhost:8081 \
176182
--skip-contour-install \
177183
--set dashboard.enabled=false \
178-
--set global.azureWorkloadIdentity.enabled=true \
184+
--set global.azureWorkloadIdentity.enabled=true \
185+
--set global.azureWorkloadIdentity.clientId="${AZURE_CLIENT_ID}" \
179186

180187
echo "Installing Dapr on Kubernetes..."
181188
helm repo add dapr https://dapr.github.io/helm-charts --force-update >/dev/null 2>&1

.github/workflows/validate-azure-recipes.yaml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,24 @@ jobs:
102102
echo "Helm releases:"
103103
helm list -n radius-default
104104
echo ""
105+
echo "Helm manifest for workload-identity-webhook (to confirm resource names):"
106+
helm get manifest workload-identity-webhook -n radius-default || echo "Unable to retrieve manifest"
107+
echo ""
105108
echo "Deployments in radius-default:"
106109
kubectl get deployments -n radius-default
107110
echo ""
108111
echo "Pods in radius-default:"
109112
kubectl get pods -n radius-default
110113
echo ""
111-
if kubectl get deployment -n radius-default workload-identity-webhook &>/dev/null; then
112-
echo "Webhook deployment exists. Describing deployment:"
113-
kubectl describe deployment workload-identity-webhook -n radius-default
114+
WEBHOOK_DEPLOYMENT=$(kubectl get deployment -n radius-default -l app=workload-identity-webhook -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true)
115+
if [ -n "$WEBHOOK_DEPLOYMENT" ]; then
116+
echo "Webhook deployment '$WEBHOOK_DEPLOYMENT' exists. Describing deployment:"
117+
kubectl describe deployment "$WEBHOOK_DEPLOYMENT" -n radius-default
114118
else
115119
echo "❌ Webhook deployment not found"
120+
echo "Listing all deployments/pods in radius-default for debugging:"
121+
kubectl get deployments -n radius-default -o wide
122+
kubectl get pods -n radius-default -o wide
116123
fi
117124
echo ""
118125
echo "Checking webhook configuration selectors:"
@@ -146,9 +153,8 @@ jobs:
146153
fi
147154
148155
echo ""
149-
echo "=== 2. Checking service account annotations kubectl ==="
150-
kubectl get serviceaccount -n radius-system -o json | \
151-
jq -r '.items[] | "\(.metadata.name): " + (if (.metadata.annotations // {})["azure.workload.identity/client-id"] then "ANNOTATION_PRESENT" else "ANNOTATION_MISSING" end)'
156+
echo "=== 2. applications-rp pod annotations ==="
157+
kubectl get pod -n radius-system -l app.kubernetes.io/name=applications-rp -o json | jq -r '.items[] | "--- " + .metadata.name + " ---\n" + (((.metadata.annotations // {}) | tojson))'
152158
153159
echo ""
154160
echo "=== 3. Checking pod labels ==="
@@ -177,6 +183,31 @@ jobs:
177183
- name: Test Azure Recipes
178184
run: make test-azure-recipes
179185

186+
- name: Collect Radius pod logs
187+
if: always()
188+
run: |
189+
mkdir -p radius-pod-logs
190+
APP_POD=$(kubectl get pods -n radius-system -o json | jq -r '.items[] | select(.metadata.name | startswith("applications-rp-")) | .metadata.name' | head -n1)
191+
if [ -n "$APP_POD" ]; then
192+
kubectl logs "$APP_POD" -n radius-system --all-containers > radius-pod-logs/applications-rp.log || true
193+
else
194+
echo "applications-rp pod not found" > radius-pod-logs/applications-rp.log
195+
fi
196+
DE_POD=$(kubectl get pods -n radius-system -o json | jq -r '.items[] | select(.metadata.name | test("^(deployment-engine|bicep-de)-")) | .metadata.name' | head -n1)
197+
if [ -n "$DE_POD" ]; then
198+
kubectl logs "$DE_POD" -n radius-system --all-containers > radius-pod-logs/deployment-engine.log || true
199+
else
200+
echo "deployment engine pod not found" > radius-pod-logs/deployment-engine.log
201+
fi
202+
203+
- name: Upload Radius pod logs
204+
if: always()
205+
uses: actions/upload-artifact@v4
206+
with:
207+
name: radius-pod-logs
208+
path: radius-pod-logs
209+
if-no-files-found: warn
210+
180211
- name: Cleanup Azure Resources
181212
if: always()
182213
run: make cleanup-azure-resources

0 commit comments

Comments
 (0)