-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Update python syntax in OAuth2 example #5000
Conversation
Welcome @headcr4sh! |
Hi @headcr4sh. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -55,7 +55,7 @@ kubectl create -f https://raw.githubusercontent.com/kubernetes/kops/master/addon | |||
|
|||
- OAUTH2_PROXY_CLIENT_ID with the github `<Client ID>` | |||
- OAUTH2_PROXY_CLIENT_SECRET with the github `<Client Secret>` | |||
- OAUTH2_PROXY_COOKIE_SECRET with value of `python -c 'import os,base64; print base64.b64encode(os.urandom(16))'` | |||
- OAUTH2_PROXY_COOKIE_SECRET with value of `python -c 'import os,base64; print(base64.b64encode(os.urandom(16)).decode("ascii"))'` |
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.
Python 3 changed the way in which bytes are being printed.
Therefore the addional decode
invocation is needed to avoid strings that look like b'__base64_encoded_data__'
.
/ok-to-test |
/lgtm |
@headcr4sh thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, headcr4sh 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 |
Codecov Report
@@ Coverage Diff @@
## master #5000 +/- ##
=========================================
- Coverage 58.52% 58.5% -0.03%
=========================================
Files 88 88
Lines 6783 6791 +8
=========================================
+ Hits 3970 3973 +3
- Misses 2377 2380 +3
- Partials 436 438 +2
Continue to review full report at Codecov.
|
/retest |
Since Python 2.x has been retired, it makes sense to update code examples to the new Python 3 syntax.
Sidenote: Invoking
print
as a function (instead of using the depreacted Python 2.x built-in) is also backwards compatible to Python 2, so this is by no means a "breaking change".What this PR does / why we need it:
Improvement of the documentation
Types of changes