From 5c736a1b854f1e5dfe3fbbcebaf02845a049af41 Mon Sep 17 00:00:00 2001 From: Paulo Truta Date: Sun, 5 Nov 2023 02:01:16 +0100 Subject: [PATCH] Adjustments to cloud options, env location and expected vars --- internal/system/system.go | 12 ++++++++++++ internal/utils/utils.go | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/system/system.go b/internal/system/system.go index 42fe285..2d8d9bc 100644 --- a/internal/system/system.go +++ b/internal/system/system.go @@ -92,6 +92,18 @@ func SetupCloudOptions() { utils.WriteOption("EMAIL", cloudEnv["EMAIL"]) } + if cloudEnv["USERNAME"] != "" { + utils.WriteOption("USERNAME", cloudEnv["USERNAME"]) + } + + if cloudEnv["CLUSTER"] != "" { + utils.WriteOption("CLUSTER", cloudEnv["CLUSTER"]) + } + + if cloudEnv["CLUSTER_IP"] != "" { + utils.WriteOption("CLUSTER_IP", cloudEnv["CLUSTER_IP"]) + } + if cloudEnv["EDGEBOXIO_API_TOKEN"] != "" { utils.WriteOption("EDGEBOXIO_API_TOKEN", cloudEnv["EDGEBOXIO_API_TOKEN"]) } diff --git a/internal/utils/utils.go b/internal/utils/utils.go index 6d336f9..8b43984 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -132,7 +132,7 @@ func GetPath(pathKey string) string { if env["CLOUD_ENV_FILE_LOCATION"] != "" { targetPath = env["CLOUD_ENV_FILE_LOCATION"] } else { - targetPath = "/home/system/components/edgeboxctl/cloud.env" + targetPath = "/home/system/components/api/cloud.env" } case ApiEnvFileLocation: