ztunnel icon indicating copy to clipboard operation
ztunnel copied to clipboard

Cleanup `illegal_ports` and ARC all of PI

Open bleggett opened this issue 1 year ago • 6 comments

This is mostly just pushing some minor local cleanups.

  • Arc all of ProxyInputs. We can probably de-arc some of the bits inside so they aren't double-arc'd eventually, but handlers shouldn't be able to get mut-ref to anything in PI - if they need to, it doesn't belong in PI.

  • Put illegal_ports in config - it is effectively config anyway - all the values are sourced from config, and everywhere we use illegal_ports we already have config.

bleggett avatar May 10 '24 18:05 bleggett

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

istio-testing avatar May 10 '24 18:05 istio-testing

ah we do the test in namespaced which doesn't use dynamic ports

howardjohn avatar May 10 '24 20:05 howardjohn

How can this work in tests where we use dynamic ports?

We don't allow people to customize the listener ports (they're consts in the config which is where the listeners && illegal_ports both get them from) so if there are any tests that use dynamic ports, that's a bit suspect/spurious (but yeah, I don't think any do).

bleggett avatar May 10 '24 21:05 bleggett

@bleggett in direct we do, we just don't care about the illegal ports there

howardjohn avatar May 10 '24 21:05 howardjohn

@bleggett in direct we do, we just don't care about the illegal ports there

Yeah I'm taking a look at those.

bleggett avatar May 10 '24 21:05 bleggett

@bleggett in direct we do, we just don't care about the illegal ports there

Yeah I'm taking a look at those.

What it boils down to is we break normal/prod behavior just for the purpose of some integration tests, and we have to add punchthrus to support providing a latebound HBONE port, when in every case outside of those few tests doing so would be a bug/a bad thing.

Proper solution is to move everything in direct to namespaced and drop the random HBONE port assignment to avoid port conflicts without relying on test-only structural hacks, but for now I've just prevented the use of said hack outside test code.

bleggett avatar May 13 '24 15:05 bleggett