Refactor non-interactive sessions out of proxy/sess.go #12497
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.
We currently handle both noninteractive sessions and interactive ones in the same code, this is quite messy and prone to error since you constantly need to be aware and add checks where appropriate. As noninteractive sessions are vastly simpler to implement and do not support moderation, I feel we're better served by a freestanding handler for these requests.
EDIT: Turns out this also fixes #12229 and #12292. Not sure when the issue causing them appeared, but this fixes it. This has been manually tested and k8s tests now pass. As it turns out, they previously didn't pass (not all of them, the non interactive exec failed).
note: This happened sometime after v9 but we don't run k8s tests in CI so it's hard to pinpoint where. We should look into running k8s tests in CI to catch k8s regressions since they're a lot of work to run locally each time.