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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we get a typed nil here in the first place? Your fix is pragmatic, but I wonder whether we can't get rid of the untyped nil instead. This probably isn't the only case where it's problematic and we really ought to move away from global variables influencing behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lmb When I introduced the hive cell for the Proxy (PR), the existing behaviour has been kept - to keep the PR as small as possible. -> If L7 proxy is disabled, the hive provider returns nil.
But i see it exactly like you - it's confusing and this logic bloats into all the modules - even though it seems as this is the only problematic case, all other cases are already checking with the config property or doing the reflection-based check.
It's just that I thought it's best to handle this as a bug and just fix it.
I plan to extract an interface for the proxy in a follow up PR anyway. This might be the chance to return an implementation which acts accordingly when L7 proxy functionality is disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes sense. I've run into this as well :(