tilt-dev / tilt-dev/tilt

Make it easier to get to a correct image_json_path on k8s_kind

Open
#5,329 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
10.1k
Forks
413
Avg merge
1d 10h
Merged PRs (30d)
6

Description

Describe the Feature You Want

json paths can be a bit tricky to get right. When calling k8s_kind with an image_json_path to tell Tilt how to find the image for a CRD, Tilt could do more to know when they've got it wrong or right, and to iterate.

Some potential changes:

  • When an image_json_path doesn't match an image, search the json for known image names. Give the user a list of image / json_path pairs that appear in the json and ask if they meant one of those.
  • Something like https://jsonpathfinder.com/ (whether integrating into Tilt, or providing a hyperlink to a form w/ prepopulated json and path)
  • Change missing image_json_path from error to warning, so that users can iterate on an individual CRD instance before being forced to fix all the other CRDs. (which has the con of making it easier for a user to miss when they've got it wrong)
Current Behavior

When an image_json_path doesn't match, you get:

Loading Tiltfile at: /Users/matt/go/src/github.com/tilt-dev/tilt/integration/crd/Tiltfile
Matching (json_path="{.spec.image}"): image is not found
Why Do You Want This?

Iterating on json paths can be annoying in normal cases, and extra annoying when iteration involves a whole Tiltfile:

  • Anything else the Tiltfile does means execution itself takes more time.
  • Output from the Tiltfile means you have to scan through it to figure out whether you succeeded.
Additional context

related: #5326

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 at the k8s_kind handling for image_json_path and reproduce the current “Matching (json_path=...): image is not found” behavior from the Tiltfile example. Review related issue #5326 and decide which feedback path is in scope; done should include a defined, tested behavior for incorrect or missing paths that makes CRD iteration easier.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.