-
Notifications
You must be signed in to change notification settings - Fork 3.4k
BUGFIX: token file should not be decoded #183
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #183 +/- ##
=========================================
+ Coverage 94.46% 94.56% +0.1%
=========================================
Files 9 9
Lines 668 681 +13
=========================================
+ Hits 631 644 +13
Misses 37 37
Continue to review full report at Codecov.
|
@mbohlool Thank you! |
kubernetes/config/kube_config.py
Outdated
content of obj[%file_key_name] and represent it as file or data. | ||
Note that the data is preferred. The obj[%file_key_name] will be used iff | ||
obj['%data_key_name'] is not set or empty. Assumption is file content is | ||
raw data and data field is base64 string.""" |
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: I may be wrong but shouldn't we update comment to reflect that raw data can be base64 encoded now?
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.
Added a comment explaining the flag. Thanks.
t = FileOrData(obj=obj, file_key_name=TEST_FILE_KEY, | ||
base64_file_content=False) | ||
self.assertEqual(TEST_DATA, t.as_data()) | ||
|
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.
So, I am not able to find test case for base64_file_content=True. I might have missed something here as I am new to the codebase. One more thing, what's the difference between this test-case and the one above, I think, since base64_file_content=False by default, the -ve scenario may be same as the old one. Please correct me, if I am wrong.
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.
base64_file_content
default value is True
. So the test case above is testing True
case and this one is testing the False
case.
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.
Apologies, I wrote my other comment in haste. In fact, I was thinking the default value is False.
|
||
def __init__(self, obj, file_key_name, data_key_name=None, | ||
file_base_path=""): | ||
file_base_path="", base64_file_content=True): |
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.
@ravisantoshgudimetla this is where I set the default value to True
.
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 misread this part. Thanks for correcting.
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.
Except for the NIT, code looks good.
…pstream-release-1.0 Automated cherry pick of #183
…d-cherry-pick-of-#183-upstream-release-1.0 Revert "Automated cherry pick of #183"
Fixes #182
Also patch this to Release 1.0.