tilt-dev / tilt-dev/tilt

workload_to_resource_function does nothing for resources from docker_compose or dc_resource

Open
#6,324 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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
  1. git clone git@github.com:tilt-dev/tilt-example-docker-compose.git
  2. 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)
  1. run tilt up
  2. hit CTRL+C
  3. comment out the dc_resource lines in the Tiltfile
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.