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

dc_resource's new_name parameter causes Tiltfile warnings if docker depends_on is used with that resource #6325

Closed
kinland opened this issue Mar 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kinland
Copy link
Contributor

kinland commented Mar 5, 2024

Expected Behavior

if you use dc_resource's new_name argument, docker compose resources with depends_on should not have changed behavior.

Current Behavior

if you use dc_resource's new_name argument, it correctly renames that resource, but you get warnings in the Tiltfile that dependencies were ignored. This could potentially cause issues due to race conditions, etc. Adding in resource_deps to match the new name doesn't make any change.

The below repro steps produce this error:

resource app specified a dependency on unknown resource redis - dependency ignored

As a result, app does not start

Steps to Reproduce

  1. git clone git@github.com:tilt-dev/tilt-example-docker-compose.git
  2. modify docker-compose.yml so that app has depends_on: redis:
  app:
    depends_on:
      - redis
  1. modify Tiltfile so that redis is renamed to myredis
dc_resource('redis', labels=["database"], new_name='myredis')
  1. 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

Ultimately, my goal was to shorten the sidebar in Tilt's web GUI. It appears that using new_name changes the display name there without changing the docker container name, which is what I want, but using new_name appears to breaks dependencies. I first tried using workload_to_resource_function, but when that didn't work, I filed #6324 . Then I tried new_name and that didn't quite work right, either.

@kinland kinland added the bug Something isn't working label Mar 5, 2024
kinland added a commit to kinland/tilt-dockerfix that referenced this issue Mar 5, 2024
…problems (tilt-dev#6325)

Signed-off-by: Kinland <16787581+kinland@users.noreply.github.com>
kinland added a commit to kinland/tilt-dockerfix that referenced this issue Mar 5, 2024
…problems (tilt-dev#6325)

Signed-off-by: Kinland <16787581+kinland@users.noreply.github.com>
kinland added a commit to kinland/tilt-dockerfix that referenced this issue Mar 15, 2024
…problems (tilt-dev#6325)

Signed-off-by: Kinland <16787581+kinland@users.noreply.github.com>
nicks pushed a commit that referenced this issue Mar 15, 2024
…problems (#6325) (#6327)

* dockercompose: fix dc_resource new_name parameter causing depends_on problems (#6325)

Signed-off-by: Kinland <16787581+kinland@users.noreply.github.com>

* dockercompose: add new_name tests + fix resourceDep bug from previous commit

Signed-off-by: Kinland <16787581+kinland@users.noreply.github.com>

---------

Signed-off-by: Kinland <16787581+kinland@users.noreply.github.com>
@kinland kinland closed this as completed Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant