-
Notifications
You must be signed in to change notification settings - Fork 185
Improve similarity with kubectl in handling of oidc kubeconfigs #144
Conversation
Welcome @mogaika! |
Codecov Report
@@ Coverage Diff @@
## master #144 +/- ##
==========================================
+ Coverage 93.41% 93.42% +<.01%
==========================================
Files 13 13
Lines 1398 1399 +1
==========================================
+ Hits 1306 1307 +1
Misses 92 92
Continue to review full report at Codecov.
|
/cc |
i think you mean "Improve similarity with kubectl" instead of "Improve similarity with kubelet" |
config/kube_config.py
Outdated
provider['config']['client-secret']), | ||
verify=config.ssl_ca_cert if config.verify_ssl else None | ||
client_secret), | ||
verify=config.ssl_ca_cert if config.verify_ssl else False |
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.
As you pointed out in the issue, verify
can be either a boolean or a string. When verify
is None
, the requests Session tries to look for requests environment configuration. I wonder what's the implication of changing verify
to False
here? More importantly, what's the expected behavior when idp-certificate-authority-data
is empty in kubeconfig (and verify_ssl
being False as a result)
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.
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 don't have more context. please add a unit test that fails before the PR, and works after the PR.
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.
My logic was based on the fact that kubectl ignores cert verification problems (like I had in #142). And since request method description notes that 'verify' parameter can be either bool or string, I thought that original code planned to use False instead of None, because its strange to explicitly point that 'verify' parameter must be None since it's None by default. I remove the parameter change from this commit since it's another unclear subject to discuss (if kubectl ignores verification problems is problem of kubectl or no, and does python client mimic this strange behaviour)
@mogaika could you provide an update to the comment above? |
4b9da57
to
8f41346
Compare
config/kube_config.py
Outdated
@@ -361,13 +361,14 @@ def _refresh_oidc(self, provider): | |||
return | |||
|
|||
response = json.loads(response.data) | |||
client_secret = provider['config'].safe_get('client-secret') or '' |
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.
Should client_secret be empty string or None? Could you show what kubectl sends?
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've stumbled on the same issue, and while poking around, None
is what works, so just delete the 'or' clause
- allow 'client-secret' to be empty
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. I understand the commands that are listed here. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
/lgtm allowing client-secret to be empty looks good. Please fix the |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mogaika, roycaihw 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 |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closed this PR. In response to this:
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. |
Can we re-open this one? I'm facing the same issue here. |
/reopen |
@yliaog: Reopened this PR. In response to this:
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. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closed this PR. In response to this:
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. |
Fixes: #142