File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ include(CheckFunctionExists)
2
2
3
3
check_function_exists (strndup HAVE_STRNDUP )
4
4
check_function_exists (secure_getenv HAVE_SECURE_GETENV )
5
+ check_function_exists (getenv HAVE_GETENV )
Original file line number Diff line number Diff line change @@ -111,19 +111,18 @@ static char *getWorkingConfigFile(const char *configFileNamePassedIn)
111
111
configFileName = strdup (configFileNamePassedIn );
112
112
} else {
113
113
114
- #if defined(WIN32 ) || defined(_WIN32 ) || defined(__WIN32__ ) || defined(__NT__ ) || defined(__APPLE__ ) || !defined(HAVE_SECURE_GETENV )
115
- kubeconfig_env = getenv (ENV_KUBECONFIG );
116
- #elif __linux || defined(__EMSCRIPTEN__ )
114
+ #if defined(HAVE_SECURE_GETENV )
117
115
kubeconfig_env = secure_getenv (ENV_KUBECONFIG );
116
+ #elif defined(HAVE_GETENV )
117
+ kubeconfig_env = getenv (ENV_KUBECONFIG );
118
118
#endif
119
119
if (kubeconfig_env ) {
120
120
configFileName = strdup (kubeconfig_env );
121
121
} else {
122
- #if defined(WIN32 ) || defined(_WIN32 ) || defined(__WIN32__ ) || defined(__NT__ ) || defined(__APPLE__ ) || !defined(HAVE_SECURE_GETENV )
123
- homedir_env = getenv (ENV_HOME );
124
- #elif __linux || defined(__EMSCRIPTEN__ )
122
+ #if defined(HAVE_SECURE_GETENV )
125
123
homedir_env = secure_getenv (ENV_HOME );
126
- #else
124
+ #elif defined(HAVE_GETENV )
125
+ homedir_env = getenv (ENV_HOME );
127
126
#endif
128
127
if (homedir_env ) {
129
128
int configFileNameSize = strlen (homedir_env ) + strlen (KUBE_CONFIG_DEFAULT_LOCATION ) + 1 ;
You can’t perform that action at this time.
0 commit comments