File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
util/src/main/java/io/kubernetes/client/util Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public class KubeConfig {
3434 private static final Logger log = LoggerFactory .getLogger (KubeConfig .class );
3535
3636 // Defaults for where to find a kubeconfig file
37- public static final String ENV_HOME = "HOME" ;
37+ public static final String ENV_HOME ;
3838 public static final String KUBEDIR = ".kube" ;
3939 public static final String KUBECONFIG = "config" ;
4040 private static Map <String , Authenticator > authenticators = new HashMap <>();
@@ -63,6 +63,12 @@ public static void registerAuthenticator(Authenticator auth) {
6363 static {
6464 registerAuthenticator (new GCPAuthenticator ());
6565 registerAuthenticator (new AzureActiveDirectoryAuthenticator ());
66+
67+ if (System .getProperty ("os.name" ).toLowerCase ().startsWith ("windows" )) {
68+ ENV_HOME = "USERPROFILE" ;
69+ } else {
70+ ENV_HOME = "HOME" ;
71+ }
6672 }
6773
6874 /** Load a Kubernetes config from a Reader */
You can’t perform that action at this time.
0 commit comments