File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -44,16 +44,19 @@ jobs:
4444 echo "${{ secrets.KUBE_CONFIG }}" > ~/.kube/config
4545 chmod 600 ~/.kube/config
4646
47- - name : Apply K8s manifests
48- run : kubectl apply -f infra/k8s/apps/${{ matrix.app }}-deployment.yaml
49-
50- - name : Detect namespace
47+ - name : Detect namespace from manifest
5148 id : detect-namespace
5249 run : |
53- namespace=$(kubectl get deployment ${{ matrix.app }} -A -o jsonpath='{.items[0].metadata.namespace}' 2>/dev/null || echo "default")
50+ namespace=$(grep -A 5 "kind: Deployment" infra/k8s/apps/${{ matrix.app }}-deployment.yaml | grep "namespace:" | head -1 | awk '{print $2}' || echo "default")
51+ if [ -z "$namespace" ]; then
52+ namespace="default"
53+ fi
5454 echo "namespace=$namespace" >> $GITHUB_OUTPUT
5555 echo "Detected namespace: $namespace"
5656
57+ - name : Apply K8s manifests
58+ run : kubectl apply -f infra/k8s/apps/${{ matrix.app }}-deployment.yaml
59+
5760 - name : Check if app has custom image
5861 id : check-image
5962 run : |
You can’t perform that action at this time.
0 commit comments