Skip to content

Commit

Permalink
Merge pull request #9404 from nojnhuh/tilt-deploy
Browse files Browse the repository at this point in the history
🌱 allow non-provider Deployments in Tilt
  • Loading branch information
k8s-ci-robot authored Nov 20, 2023
2 parents 2e8d738 + 7295e19 commit 2f3e085
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

Expand Down
4 changes: 4 additions & 0 deletions hack/tools/internal/tilt-prepare/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down

0 comments on commit 2f3e085

Please sign in to comment.