From 7295e19c4ce58775810b014bb1050c039513befc Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Tue, 12 Sep 2023 00:22:27 -0500 Subject: [PATCH] :seedling: allow non-provider Deployments in Tilt --- Tiltfile | 3 ++- hack/tools/internal/tilt-prepare/main.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Tiltfile b/Tiltfile index 65e60870ac6a..2962d33858c2 100644 --- a/Tiltfile +++ b/Tiltfile @@ -382,7 +382,8 @@ def enable_provider(name, debug): def find_object_name(objs, kind): for o in objs: - if o["kind"] == kind: + # Ignore objects that are not part of the provider, e.g. the ASO Deployment in CAPZ. + if o["kind"] == kind and "cluster.x-k8s.io/provider" in o["metadata"]["labels"]: return o["metadata"]["name"] return "" diff --git a/hack/tools/internal/tilt-prepare/main.go b/hack/tools/internal/tilt-prepare/main.go index 5e7f4f7e6ba9..c00c61fc85f2 100644 --- a/hack/tools/internal/tilt-prepare/main.go +++ b/hack/tools/internal/tilt-prepare/main.go @@ -871,6 +871,10 @@ func updateDeployment(prefix string, objs []unstructured.Unstructured, f updateD if obj.GetKind() != "Deployment" { continue } + // Ignore Deployments that are not part of the provider, eg. ASO in CAPZ. + if _, exists := obj.GetLabels()[clusterv1.ProviderNameLabel]; !exists { + continue + } // Convert Unstructured into a typed object d := &appsv1.Deployment{}