contour
contour copied to clipboard
internal/dag: add explicit check that virtualhost.TCPProxy is never overwritten.
There should be compensating controls that ensure when a HTTPProxy TCPProxy is processed we never overwrite the TCPProxy value on the resulting securevirtualhost. But that's not stated explicitly, or tested, and it would be good to cover both of those cases.
@davecheney I'll take a stab at this one if that's ok?
@PhilipGough sure thing but please, before sending any code, please write a sketch of your change here. Specifically, if this invariant is broken, what happens? Logging is not appropriate as dag rebuilds happen constantly. Panicking or otherwise aborting are not appropriate because that will stall unrelated updates.
@davecheney perhaps I misunderstood the task (highly likely since I'm new to the codebase) but from reading your description I thought the change was straightforward enough (https://github.com/projectcontour/contour/compare/master...PhilipGough:1777?expand=1)
From your description though, it seems like I am on the wrong track so if you have any pointers for where I should be working in that would be appreciated.
@PhilipGough thanks for your reply. The outstanding problem is what to do when the invariant that svh.TCPProxy == nil
is violated? Should that invalidate the httpproxy object? Should it be logged? when and where should it be logged -- we generally don't log during dag rebuilds as those happen frequently and will cause log spam and lead to issues where customers ask us to turn down the logging -- trading one problem for another.
To proceed, the answer to the question "what happens if svh.TCPProxy != nil
needs to be defined.
@davecheney thanks for your response, makes sense to me now. Let me see if I can progress this then, seems like a good opportunity to dig through the code base if nothing else. Thanks
Hey @PhilipGough just wanted to circle back on this issue. Are you still working on it?
@stevesloka to be honest, after spending a very short time on it initially, my scope to work on it got reduced and I never managed to circle back around on it so feel free to open it yourself/others.
If it doesn't get picked up in the mean time I'll revisit it as soon as I can.