From ff127b6580ff2b0fdb4d5cc91c0c1d15dddc714b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Fern=C3=A1ndez?= Date: Thu, 19 Oct 2023 22:34:20 -0500 Subject: [PATCH] fix: remove unnecessary env (#209) --- internal/db/mongo.go | 6 +----- main.go | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/internal/db/mongo.go b/internal/db/mongo.go index 88624a0f..88191bd4 100644 --- a/internal/db/mongo.go +++ b/internal/db/mongo.go @@ -88,7 +88,7 @@ func (mdbcl *MongoDBClient) TestDatabaseConnection(silent bool) error { } // ImportClusterIfEmpty -func (mdbcl *MongoDBClient) ImportClusterIfEmpty(silent bool, cloudProvider string) (pkgtypes.Cluster, error) { +func (mdbcl *MongoDBClient) ImportClusterIfEmpty(silent bool) (pkgtypes.Cluster, error) { log.SetFormatter(&log.TextFormatter{ FullTimestamp: true, TimestampFormat: "", @@ -102,10 +102,6 @@ func (mdbcl *MongoDBClient) ImportClusterIfEmpty(silent bool, cloudProvider stri log.Info("IS_CLUSTER_ZERO is set to true, skipping import cluster logic.") return pkgtypes.Cluster{}, nil } - if os.Getenv("CLOUD_PROVIDER") == "k3d" { - log.Info("CLOUD_PROVIDER is set to k3d, skipping import cluster logic.") - return pkgtypes.Cluster{}, nil - } homeDir, err := os.UserHomeDir() if err != nil { diff --git a/main.go b/main.go index 55edeb9a..29ec7832 100644 --- a/main.go +++ b/main.go @@ -51,7 +51,7 @@ func main() { if os.Getenv("MONGODB_HOST_TYPE") == "" { log.Fatalf("the MONGODB_HOST_TYPE environment variable must be set to either: atlas, local") } - for _, v := range []string{"MONGODB_HOST", "MONGODB_USERNAME", "MONGODB_PASSWORD", "CLOUD_PROVIDER"} { + for _, v := range []string{"MONGODB_HOST", "MONGODB_USERNAME", "MONGODB_PASSWORD"} { if os.Getenv(v) == "" { log.Fatalf("the %s environment variable must be set", v) } @@ -79,7 +79,7 @@ func main() { log.Infof("checking for cluster import secret for management cluster") // Import if needed - importedCluster, err := db.Client.ImportClusterIfEmpty(false, os.Getenv("CLOUD_PROVIDER")) + importedCluster, err := db.Client.ImportClusterIfEmpty(false) if err != nil { log.Fatal(err) }