-
Notifications
You must be signed in to change notification settings - Fork 184
fix: read config data with bytes (python3) #86
fix: read config data with bytes (python3) #86
Conversation
config/kube_config_test.py
Outdated
@@ -65,6 +65,9 @@ def _raise_exception(st): | |||
TEST_DATA = "test-data" | |||
TEST_DATA_BASE64 = _base64(TEST_DATA) | |||
|
|||
TEST_DATA_BYTES = b"test-data" | |||
TEST_DATA_BASE64_BYTES = b"dGVzdC1kYXRh" |
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.
nit: you can use TEST_DATA.encode()
or bytes(TEST_DATA, encoding='utf-8')
instead of introducing new variables
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.
+1, fixed
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.
Thanks! Could you squash the commits?
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.
Done
e70e982
to
9d78cd7
Compare
/test all |
I have no idea how to test it again. The previous build failed but it looks like an Travis' issue. |
/lgtm Tests are green now. I manually re-triggered the tests. It would be great if we have the retest commends. Maybe worth a test-infra issue... |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: roycaihw, tomplus The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I came across a problem where
kubeconfig
has certificates stored as binary data.Python 3 sees this as bytes and the encoding problem appears.
In this PR I've added a check if
_data
are thestr
type.Thanks.