-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow extra headers in Barrage session creation #5637
Allow extra headers in Barrage session creation #5637
Conversation
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.
LGTM
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.
Can we add at least a basic test to make sure that the code doesn't NPE or anything when extra headers are supplied, and maybe that they actually flow through to the config?
py/server/tests/test_barrage.py
Outdated
@@ -59,7 +59,7 @@ def tearDown(self) -> None: | |||
self.pub_session.close() | |||
|
|||
def test_barrage_session(self): | |||
session = barrage_session(host="localhost", port=10000, auth_type="Anonymous") | |||
session = barrage_session(host="localhost", port=10000, auth_type="Anonymous", extra_headers={"envoy-prefix": "test"}) |
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.
Interesting choice of the header name, I thought in a cluster deployment, a server-server connection doesn't involve envoy.
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.
I'd also like to add a test method such as def test_barrage_session_with_extra_headers
instead of modifying the existing one.
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.
The intended and tested use case (in Core+) is client-server where "client" is outside of "server"'s cluster. Feel free to change header to whatever is better suited for Core tests. I just chose what was familiar.
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.
I moved the change to its own test as suggested.
Satisfies #5636.