Allow lazy container info in log forwarding #48415
Merged
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.
In the presence of #47610, the "redis-client" tab in the dev ui disappears, and in dev mode, if you hit 'g' you no longer get the container logs. This PR moves the
getContainerInfo
later, to inside lambas, so that it's got the runtime info. For dev services which aren't started in deployment phase, the result ofgetContainerInfo
in the deployment phase will always be null, which makes it a non-ideal guard to use in the deployment phase.This doesn't change behaviour on the main paths, but allows log tabs and
g
for logs in the Dev UI to work.Keeping this as its own PR to make everything easier to review.
One thing this PR does change is that the old behaviour used a map indexed by container id for the log forwarders. That would mean a maximum of one tab per container. Now, if multiple services used the same container, there would be multiple tabs. I'm not sure how likely that is. The map seems to predate the compose dev service by about three years, so it wasn't introduced to support that.