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{}