Skip to content
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

Adds support for custom Server Name Indication (SNI) #1933

Merged

Conversation

tigrato
Copy link
Contributor

@tigrato tigrato commented Oct 21, 2022

What type of PR is this?

/kind bug

What this PR does / why we need it:

This PR adds support for custom SNI values. If tls-server-name is set in kubeconfig, the client did not use it resulting in SSL/TLS errors if the property is required to connect to the server.

Which issue(s) this PR fixes:

Fixes #1889

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fixed `tls-server-name` (SNI)  property usage when explicitly set in kubeconfig.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 21, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @tigrato!

It looks like this is your first PR to kubernetes-client/python 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-client/python has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 21, 2022
@yliaog
Copy link
Contributor

yliaog commented Oct 24, 2022

/assign @roycaihw

@tigrato
Copy link
Contributor Author

tigrato commented Nov 29, 2022

@yliaog @roycaihw

Is there any possibility to include this PR in the next release?

@benhe-crypto
Copy link

Hi tigrato, could u plz fix ur version string? Invalid PEP 440 version: '25.0.0-snapshot' thanks

@dboslee
Copy link

dboslee commented Jan 27, 2023

Hi @fabianvf and @roycaihw. Are either of you free to give this a review? Thank you 🙌

@@ -77,6 +77,9 @@ def __init__(self, configuration, pools_size=4, maxsize=None):
if configuration.retries is not None:
addition_pool_args['retries'] = configuration.retries

if configuration.tls_server_name:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I think this file is generated, in order to make permanent changes here I believe the PR would need to go to the generator repo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide some more information on what to do? Because the gen repo doesn't really say nor point to what needs to be updated. The contributing guide doesn't go into detail either.

This file seems to ref https://github.com/kubernetes-client/gen/blob/master/proto/dependencies.sh even more generated files from the apimachinery repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabianvf @yliaog

The auto-generated code is available for openapi-generator version >=6.6.0 (PR).

Since this repo uses version v4.3.0, I decided to apply a patch - similar to the current one that exists - to apply the necessary changes to support SNI. Once we start using a version that includes the upstream fix, the patch can be safely removed.

Can you please check it again?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR. it looks good to me, @fabianvf do you have any question or concern?

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 27, 2023
@tigrato
Copy link
Contributor Author

tigrato commented Jun 27, 2023

@yliaog can you please take a look?

Copy link

@goodspark goodspark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@fabianvf fabianvf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 31, 2023
@yliaog
Copy link
Contributor

yliaog commented Jul 31, 2023

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabianvf, goodspark, tigrato, yliaog

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2023
@k8s-ci-robot k8s-ci-robot merged commit a12df3e into kubernetes-client:master Jul 31, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client doesn't honor tls-server-name setting in kubeconfig
8 participants