tilt-dev / tilt-dev/tilt

ui does not correctly display in dynamically allocated ports "0:[port]"

Open
#6,247 0 comments 1 reaction 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

Steps to Reproduce
  1. Update tilt-example-html with
k8s_resource('example-html', port_forwards=["0:8000"])
  1. Run tilt up
  2. Visit the Tilt ui
Expected Behavior

the UI should link to the service we're port-fowarding to

Current Behavior

the UI links to localhost:0

Additional Info

The weirdest part of this bug is that the API server actually knows the correct port

$ tilt get pf -o yaml
apiVersion: v1
items:
- apiVersion: tilt.dev/v1alpha1
  kind: PortForward
  metadata:
    annotations:
      tilt.dev/log-span-id: kubernetesapply:example-html
      tilt.dev/resource: example-html
    creationTimestamp: "2023-10-10T21:53:23Z"
    name: example-html-example-html-bc598cb58-pxq7t
    ownerReferences:
    - apiVersion: tilt.dev/v1alpha1
      blockOwnerDeletion: true
      controller: true
      kind: KubernetesDiscovery
      name: example-html
      uid: 28f91202-4a98-4dd6-bf11-5e48f87c9fa4
    resourceVersion: "92"
    uid: 7b36ea85-6ab4-4cf6-a640-ab5ec31f86e7
  spec:
    cluster: default
    forwards:
    - containerPort: 8000
      host: localhost
    namespace: default
    podName: example-html-bc598cb58-pxq7t
  status:
    forwardStatuses:
    - addresses:
      - 127.0.0.1
      - ::1
      containerPort: 8000
      localPort: 46753
      startedAt: "2023-10-10T21:53:36.204691Z"
kind: List
metadata:
  resourceVersion: ""

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

Reproduce the issue with port_forwards=["0:8000"], then inspect how the Tilt UI renders port-forward links and compare that with the localPort reported by tilt get pf -o yaml. Done means the UI links to the dynamically allocated local port, such as 46753, instead of localhost:0.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.