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

Failed to load cluster configuration inside a pod by using function "load_incluster_config()" #180

Closed
gtsal opened this issue Mar 28, 2023 · 1 comment · Fixed by #181
Closed

Comments

@gtsal
Copy link

gtsal commented Mar 28, 2023

Hello,

hope you are well.

I tried to use the c client inside a pod by using the load_incluster_config()_ function but it failed because it could not read the environment variables. The reason is that the corresponding source file does not include the config.h file that is generated during the make process. So the code into #if defined(HAVE_SECURE_GETENV) and #elif defined(HAVE_GETENV) is left out.

After adding the include statement in https://github.com/kubernetes-client/c/blob/master/kubernetes/config/incluster_config.c and recompile the library I had not problem.

@ityuhui
Copy link
Member

ityuhui commented Mar 28, 2023

Thanks for reporting this and providing a solution !

I think the PR #171 forgot to add #include <config.h> into incluster_config.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants