mirror of
https://github.com/ghndrx/k8s-game-2048.git
synced 2026-02-10 06:45:07 +00:00
fix: Ensure Knative service exists before patching in staging deployment
- Apply service manifest before attempting to patch - This prevents 'resource not found' errors when staging service doesn't exist yet - Ensures proper deployment flow for staging environment
This commit is contained in:
5
.github/workflows/deploy-staging.yml
vendored
5
.github/workflows/deploy-staging.yml
vendored
@@ -59,7 +59,10 @@ jobs:
|
|||||||
kubectl apply -f -
|
kubectl apply -f -
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update image in service and deploy
|
# Apply the Knative service manifest first
|
||||||
|
kubectl apply -f manifests/staging/service.yml
|
||||||
|
|
||||||
|
# Update image in service
|
||||||
kubectl patch ksvc game-2048-staging -n game-2048-staging --type merge -p '{"spec":{"template":{"spec":{"containers":[{"image":"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}","imagePullPolicy":"Always"}]}}}}'
|
kubectl patch ksvc game-2048-staging -n game-2048-staging --type merge -p '{"spec":{"template":{"spec":{"containers":[{"image":"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}","imagePullPolicy":"Always"}]}}}}'
|
||||||
|
|
||||||
echo "⏳ Waiting for deployment to be ready..."
|
echo "⏳ Waiting for deployment to be ready..."
|
||||||
|
|||||||
Reference in New Issue
Block a user