Tiltfile Resource Assembly Migration
Tilt is changing how it combines k8s objects and images into Tilt resources. The new behavior is to simply make one Tilt resource per k8s object that has at least one container.
The TL;DR is:
- Your tilt resources’ names might change.
- You might need to change how you’re calling
- You might need to temporarily add a call to
k8s_resource_assembly_versionto the top of your Tiltfile.
k8s_resource behavior was kind of weird: sometimes you could just use
the image name, and sometimes you’d pass the yaml, and sometimes you’d pass the
image. Sometimes it was used for creating a resource, and sometimes it was used
for configuring an existing resource.
k8s_resource’s ‘yaml’ and ‘image’ parameters. It’s now a
function for configuring a workload’s resource. (See the API docs for the new
Migrating to the new behavior should mostly be a matter of:
- Add a call to
k8s_resource_assembly_version(2)to the top of your Tiltfile (if running Tilt version < 0.8.0)
- Remove any ‘yaml’ or ‘image’ args to
- and make sure any removed ‘yaml’ args from (2) are passed to
k8s_yamlsomewhere else in your Tiltfile.
- If your
k8s_resourcecalls say unknown resource (because Tilt now names by k8s object instead of image), either change the first arg to
k8s_resourceto match the new name, or use
workload_to_resource_functionto change the naming rules.
- Let any teammates know that they need to upgrade Tilt.
Please don’t hesitate to reach out if you run into any problems or confusion!