From 5cc9882e83bd26c786baaa3a8501f01c09327cc9 Mon Sep 17 00:00:00 2001
From: vinayada1 <28875764+vinayada1@users.noreply.github.com>
Date: Mon, 4 Dec 2023 19:08:12 -0800
Subject: [PATCH] Check pods are created before waiting for them to be ready
during publish recipes (#6914)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
# Description
This is a potential fix for the flaky test issue seen #6912
It is possible that we see error: no matching resources found because
the pods are not yet created. Waiting on non-existent resources can
result in this error
(https://github.com/kubernetes/kubernetes/issues/87352)
Adding a kubectl rollout status which will ensure the pods are created
before waiting on them to become ready
## Type of change
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).
Fixes: #6912
## Auto-generated summary
### ๐ค[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at 27fbda2
### Summary
๐๐งช๐จ
Add feature to generate and test Terraform recipes from YAML. Fix
formatting in `build/recipes.mk`.
> _We're the crew of the YAML ship, we sail the code sea_
> _We write our files in a simple way, to make some Terraform_
> _Heave away, me hearties, heave away with me_
> _We'll test our recipes on the web, and fix the `./build/recipes.mk`_
### Walkthrough
* Add a command to check the web server status after applying Terraform
configuration
([link](https://github.com/radius-project/radius/pull/6914/files?diff=unified&w=0#diff-d2dfe02e16036198b889fbfbe653f36f04311c2dea672498040231bfcba93d4fR50-R52))
* Remove a trailing whitespace from the echo command
([link](https://github.com/radius-project/radius/pull/6914/files?diff=unified&w=0#diff-d2dfe02e16036198b889fbfbe653f36f04311c2dea672498040231bfcba93d4fL56-R59))
---------
Signed-off-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
---
build/recipes.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build/recipes.mk b/build/recipes.mk
index a9dd34fc74..dcda7766bb 100644
--- a/build/recipes.mk
+++ b/build/recipes.mk
@@ -48,7 +48,7 @@ publish-test-terraform-recipes: ## Publishes test terraform recipes to the curre
kubectl apply -f ./deploy/tf-module-server/resources.yaml -n $(TERRAFORM_MODULE_SERVER_NAMESPACE)
@echo "$(ARROW) Waiting for web server to be ready..."
- kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=tf-module-server -n $(TERRAFORM_MODULE_SERVER_NAMESPACE) --timeout=600s
+ kubectl rollout status deployment.apps/tf-module-server -n $(TERRAFORM_MODULE_SERVER_NAMESPACE) --timeout=600s
@echo "$(ARROW) Web server ready. Recipes published to http://$(TERRAFORM_MODULE_SERVER_DEPLOYMENT_NAME).$(TERRAFORM_MODULE_SERVER_NAMESPACE).svc.cluster.local/.zip"
@echo "$(ARROW) To test use:"