Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 allow non-provider Deployments in Tilt #9404

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ensures the provider's *_controller item in tilt refers to the right Deployment.

nojnhuh marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -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 {
nojnhuh marked this conversation as resolved.
Show resolved Hide resolved
continue
}

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