From db5c781bf12b7a2c34b28c1e2efa860b7bf3cbe6 Mon Sep 17 00:00:00 2001 From: Roman Hros Date: Mon, 12 Feb 2024 13:41:01 +0100 Subject: [PATCH] Make tilt green on the first run Signed-off-by: Roman Hros --- Tiltfile | 7 +++++-- docs/develop.md | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Tiltfile b/Tiltfile index 39b2f9e9..a7bd28da 100644 --- a/Tiltfile +++ b/Tiltfile @@ -204,8 +204,11 @@ def create_secret(): local_resource('supersecret', cmd, labels=["clouds-yaml-secret"]) def cspo_template(): - cmd = "cat .cspotemplate.yaml | {} | kubectl apply -f -".format(envsubst_cmd) - local_resource('cspotemplate', cmd, labels=["cspo-template"]) + cmd = "cat .cspotemplate.yaml | {}".format(envsubst_cmd) + cspo_yaml = local(cmd, quiet=True) + k8s_yaml(cspo_yaml) + k8s_resource(objects = ["cspotemplate:openstackclusterstackreleasetemplate"], new_name = "cspotemplate", labels = ["cspo-template"]) + def clusterstack(): k8s_resource(objects = ["clusterstack:clusterstack"], new_name = "clusterstack", labels = ["clusterstack"]) diff --git a/docs/develop.md b/docs/develop.md index 2dd3218f..2b765248 100644 --- a/docs/develop.md +++ b/docs/develop.md @@ -24,7 +24,7 @@ make tilt-up > To access the Tilt UI please go to: `http://localhost:10351` -You should make sure that everything in the UI looks green. If not, you can trigger the Tilt workflow again. In the case of the `cspotemplate`, this might be necessary, as it cannot be applied right after the startup of the cluster and fails. Tilt unfortunately does not include a waiting period. +You should make sure that everything in the UI looks green. If not, you can trigger the Tilt workflow again. If everything is green, then you can already check for your clusterstack that has been deployed. You can use a tool like k9s to have a look at the management cluster and its custom resources.