diff --git a/Tiltfile b/Tiltfile index 2ddd3140c468..1ee422acdee2 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 52d8d41e17d4..9b914ed68621 100644 --- a/hack/tools/internal/tilt-prepare/main.go +++ b/hack/tools/internal/tilt-prepare/main.go @@ -842,6 +842,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{}