portforward: deprecate implicit container port behavior #5735
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tilt supports a bunch of variations when defining a port forward in
a Tiltfile.
It's possible to specify a single value (a local port), and in this
case, Tilt will look for a matching exposed port to use. If none
is found, it'll use the first exposed port.
This behavior is confusing and doesn't match existing functionality
in e.g.
kubectl
.Allowing a single port that will be used identically for local and
container is reasonable short-hand, but picking an implicit port
to map to adds extra complexity for questionable value.
In this latter case, a warning is now emitted along with the mapping
and instructions for the user to update their
Tiltfile
to make itexplicit before it breaks in a future release of Tilt.
To fully deprecate this, we can change the logic to always default
the container port to local port. However, as this will change the
behavior in the aforementioned case, it's a breaking change, so
let's provide a heads up first :)
Fixes #5728.