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

Bug: in-cluster config is passing ssl_ca_cert file path instead of the content of the file #2143

Open
yk2274 opened this issue Nov 9, 2023 · 7 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

Comments

@yk2274
Copy link

yk2274 commented Nov 9, 2023

This line is giving ssl_ca_cert the file path instead of the content of the file

https://github.com/kubernetes-client/python/blame/36cfbe68a509d9b9d33395b22b6fa94d7d46c30f/kubernetes/base/config/incluster_config.py#L85C4-L85C4

@ggree1
Copy link

ggree1 commented Nov 24, 2023

Yeah.. Is there a way to pass cert data instead of ca file path for config.ssl_ca_cert?

@roycaihw
Copy link
Member

Agreed it seems to be a bug that the code is only passing the filename instead of reading the content. Would be good if we can have a test to catch the bug.

/help

@k8s-ci-robot
Copy link
Contributor

@roycaihw:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

Agreed it seems to be a bug that the code is only passing the filename instead of reading the content. Would be good if we can have a test to catch the bug.

/help

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.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Dec 18, 2023
@roycaihw roycaihw changed the title Bug Bug: in-cluster config is passing ssl_ca_cert file path instead of the content of the file Dec 18, 2023
@ddfreiling
Copy link

This is still a bug, cannot use ansible k8s_info on a k3s node where the ~/.kube/config just contains client-certificate-data and certificate-authority-data

@abhi-dev91
Copy link

I also need the solution on the same, we have the requirement to pick the CA certificates from the databases as we are managing thousands of kubernetes clusters and could not maintation CA or kubeconfig file individually for each.

@darshanip
Copy link

darshanip commented Feb 18, 2024

@roycaihw I can help on this one. Want me to draft PR?

@fishstamp82
Copy link

When using kubectl the go library defaults to reading both settings, but the python client only reads the certificate-authority setting in the get_cluster_info.

I found test cases mentioning certificate-authority-data but its never tested.

Would the approach be similar to kubectl to add support for certificate-authority-data in this codebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Projects
None yet
Development

No branches or pull requests

8 participants