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

Issue using defaultClient on Windows #486

Closed
falken opened this issue Jan 21, 2019 · 2 comments
Closed

Issue using defaultClient on Windows #486

falken opened this issue Jan 21, 2019 · 2 comments

Comments

@falken
Copy link

falken commented Jan 21, 2019

Running this code on windows
ApiClient client = Config.defaultClient();

Generates this exception:
java.lang.NullPointerException
at java.io.File.(File.java:277)
at io.kubernetes.client.util.ClientBuilder.findHomeDir(ClientBuilder.java:121)
at io.kubernetes.client.util.ClientBuilder.findConfigInHomeDir(ClientBuilder.java:149)
at io.kubernetes.client.util.ClientBuilder.standard(ClientBuilder.java:89)
at io.kubernetes.client.util.ClientBuilder.standard(ClientBuilder.java:75)
at io.kubernetes.client.util.Config.defaultClient(Config.java:104)

The problem seems to be that System.getenv(ENV_HOME) in this line:
final File config = new File(System.getenv(ENV_HOME));
returns null, causing the File constructor to fail.

I would suggest a simple null check or default to empty string.

@brendandburns
Copy link
Contributor

This was fixed at HEAD by #455

Looks like I need to cut a new release....

@brendandburns
Copy link
Contributor

Release 4.0.0 was cut in february so this should be fixed there.

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

No branches or pull requests

2 participants