Skip to content

Commit 2f3e085

Browse files
authored
Merge pull request kubernetes-sigs#9404 from nojnhuh/tilt-deploy
🌱 allow non-provider Deployments in Tilt
2 parents 2e8d738 + 7295e19 commit 2f3e085

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Tiltfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ def enable_provider(name, debug):
382382

383383
def find_object_name(objs, kind):
384384
for o in objs:
385-
if o["kind"] == kind:
385+
# Ignore objects that are not part of the provider, e.g. the ASO Deployment in CAPZ.
386+
if o["kind"] == kind and "cluster.x-k8s.io/provider" in o["metadata"]["labels"]:
386387
return o["metadata"]["name"]
387388
return ""
388389

hack/tools/internal/tilt-prepare/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,10 @@ func updateDeployment(prefix string, objs []unstructured.Unstructured, f updateD
842842
if obj.GetKind() != "Deployment" {
843843
continue
844844
}
845+
// Ignore Deployments that are not part of the provider, eg. ASO in CAPZ.
846+
if _, exists := obj.GetLabels()[clusterv1.ProviderNameLabel]; !exists {
847+
continue
848+
}
845849

846850
// Convert Unstructured into a typed object
847851
d := &appsv1.Deployment{}

0 commit comments

Comments
 (0)