Merge pull request #84 from ahmedyarub/ay/macos_installation_adaptaions
MacOs Installation Adaptations
This commit is contained in:
@@ -45,19 +45,19 @@ static int setBasePathInCluster(char **pBasePath)
|
||||
{
|
||||
static char fname[] = "setBasePathInCluster()";
|
||||
|
||||
#ifndef _WIN32
|
||||
const char *service_host_env = secure_getenv(SERVICE_HOST_ENV_NAME);
|
||||
#else
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
|
||||
const char *service_host_env = getenv(SERVICE_HOST_ENV_NAME);
|
||||
#elif __linux
|
||||
const char *service_host_env = secure_getenv(SERVICE_HOST_ENV_NAME);
|
||||
#endif
|
||||
if (!service_host_env) {
|
||||
fprintf(stderr, "%s: Cannot retrieve the kubernetes service host inside a pod by the env %s.\n", fname, SERVICE_HOST_ENV_NAME);
|
||||
return -1;
|
||||
}
|
||||
#ifndef _WIN32
|
||||
const char *service_port_env = secure_getenv(SERVICE_PORT_ENV_NAME);
|
||||
#else
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
|
||||
const char *service_port_env = getenv(SERVICE_PORT_ENV_NAME);
|
||||
#elif __linux
|
||||
const char *service_port_env = secure_getenv(SERVICE_PORT_ENV_NAME);
|
||||
#endif
|
||||
if (!service_port_env) {
|
||||
fprintf(stderr, "%s: Cannot retrieve the kubernetes service port inside a pod by the env %s.\n", fname, SERVICE_PORT_ENV_NAME);
|
||||
|
||||
@@ -110,18 +110,20 @@ static char *getWorkingConfigFile(const char *configFileNamePassedIn)
|
||||
if (configFileNamePassedIn) {
|
||||
configFileName = strdup(configFileNamePassedIn);
|
||||
} else {
|
||||
#ifndef _WIN32
|
||||
kubeconfig_env = secure_getenv(ENV_KUBECONFIG);
|
||||
#else
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
|
||||
kubeconfig_env = getenv(ENV_KUBECONFIG);
|
||||
#elif __linux
|
||||
kubeconfig_env = secure_getenv(ENV_KUBECONFIG);
|
||||
#endif
|
||||
if (kubeconfig_env) {
|
||||
configFileName = strdup(kubeconfig_env);
|
||||
} else {
|
||||
#ifndef _WIN32
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
|
||||
homedir_env = getenv(ENV_HOME);
|
||||
#elif __linux
|
||||
homedir_env = secure_getenv(ENV_HOME);
|
||||
#else
|
||||
homedir_env = getenv(ENV_HOME);
|
||||
#endif
|
||||
if (homedir_env) {
|
||||
int configFileNameSize = strlen(homedir_env) + strlen(KUBE_CONFIG_DEFAULT_LOCATION) + 1;
|
||||
|
||||
Reference in New Issue
Block a user