workload_to_resource_function does nothing for resources from docker_compose or dc_resource
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 10.1k
- Forks
- 413
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 6
Description
Expected Behavior
If you have workload_to_resource_function in your Tiltfile, it should work on resources from docker_compose and dc_resource
Current Behavior
workload_to_resource_function appears to have no effect on either the automatic resources from docker_compose or manual resources via dc_resource
Steps to Reproduce
git clone git@github.com:tilt-dev/tilt-example-docker-compose.git- add the following to the top (or bottom) of the
Tiltfile:
def resource_name(id):
return 'foo' + '-' + id.name
workload_to_resource_function(resource_name)
- run
tilt up - hit CTRL+C
- comment out the
dc_resourcelines in theTiltfile - run
tilt up
Context
tilt doctor Output
Click to `tilt doctor` output
$ tilt doctor
Tilt: v0.33.11, built 2024-02-15
System: linux-amd64
---
Docker
- Host: unix:///var/run/docker.sock
- Server Version: 25.0.3
- API Version: 1.44
- Builder: 2
- Compose Version: v2.24.5-desktop.1
---
Kubernetes
- Env: eks
- Context: arn:aws:eks:us-west-2:**********
- Cluster Name: arn:aws:eks:us-west-2:**********
- Namespace: default
- Cluster Local Registry: none
---
About Your Use Case
I've got a project with a bunch of resources which all have long names. #4614 added resize, which is great, but I'd like to manually rename the resources in the UI to omit the prefix.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduced Tiltfile using workload_to_resource_function alongside docker_compose and dc_resource, then run tilt up to compare the automatic and manual resources. Done means the function changes resource names for both resource sources, including after the dc_resource lines are commented out.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100