From 704416258203d55b6597b6fe74b5713db039ba17 Mon Sep 17 00:00:00 2001 From: dhavalmehta07 Date: Wed, 29 Nov 2023 19:53:15 +0530 Subject: [PATCH 1/3] Multi account support --- api/environment/env.go | 2 +- internal/command/commands/env.go | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/environment/env.go b/api/environment/env.go index 7684e3af..6ce515af 100644 --- a/api/environment/env.go +++ b/api/environment/env.go @@ -11,7 +11,7 @@ type Env struct { EnvType string `yaml:"envType,omitempty" json:"envType,omitempty"` State string `yaml:"state,omitempty" json:"state,omitempty"` DeletionTime string `yaml:"autoDeletionTime,omitempty" json:"autoDeletionTime,omitempty"` - Account string `yaml:"cloudProviderAccount,omitempty" json:"cloudProviderAccount,omitempty"` + Account []string `yaml:"cloudProviderAccounts,omitempty" json:"cloudProviderAccounts,omitempty"` CreatedBy string `yaml:"createdBy,omitempty" json:"createdBy,omitempty"` UpdatedBy string `yaml:"updatedBy,omitempty" json:"updatedBy,omitempty"` CreatedAt string `yaml:"createdAt,omitempty" json:"createdAt,omitempty"` diff --git a/internal/command/commands/env.go b/internal/command/commands/env.go index adf79801..c3b7aeb6 100644 --- a/internal/command/commands/env.go +++ b/internal/command/commands/env.go @@ -24,6 +24,13 @@ type Env command const ENV_NAME_KEY = "EnvName" +func splitProviderAccount(providerAccount string) []string { + if providerAccount == "" { + return nil // Return nil when providerAccount is empty + } + return strings.Split(providerAccount, ",") +} + // Run : implements the actual functionality of the command func (e *Env) Run(args []string) int { // Define flag set @@ -62,7 +69,7 @@ func (e *Env) Run(args []string) int { } envConfig := environment.Env{ EnvType: *env, - Account: *providerAccount, + Account: splitProviderAccount(*providerAccount), Name: *name, } From e711a1e0adfe78fd6c5d1b72c42e2d3031fde64c Mon Sep 17 00:00:00 2001 From: dhavalmehta07 Date: Tue, 5 Dec 2023 19:59:26 +0530 Subject: [PATCH 2/3] update --- internal/command/commands/env.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/command/commands/env.go b/internal/command/commands/env.go index c3b7aeb6..b273a922 100644 --- a/internal/command/commands/env.go +++ b/internal/command/commands/env.go @@ -26,7 +26,7 @@ const ENV_NAME_KEY = "EnvName" func splitProviderAccount(providerAccount string) []string { if providerAccount == "" { - return nil // Return nil when providerAccount is empty + return nil } return strings.Split(providerAccount, ",") } From 8eb01835dc2e16904525ed5a7b87e16b2724232f Mon Sep 17 00:00:00 2001 From: dhavalmehta07 Date: Wed, 20 Dec 2023 21:34:30 +0530 Subject: [PATCH 3/3] Updated version --- app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 280d84db..f3e0a569 100644 --- a/app/app.go +++ b/app/app.go @@ -8,5 +8,5 @@ type application struct { // App (Application) interface var App application = application{ Name: "odin", - Version: "1.3.1", + Version: "1.3.2", }