From dba696d83b7848528848eca3f875538d77f0a57d Mon Sep 17 00:00:00 2001 From: elkezza Date: Thu, 2 Jan 2025 17:22:20 +0000 Subject: [PATCH] using global context. --- cmd/dbaas_acl_create.go | 3 +-- cmd/dbaas_acl_delete.go | 3 +-- cmd/dbaas_acl_list.go | 3 +-- cmd/dbaas_acl_update.go | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/cmd/dbaas_acl_create.go b/cmd/dbaas_acl_create.go index 81acd94c..925f1488 100644 --- a/cmd/dbaas_acl_create.go +++ b/cmd/dbaas_acl_create.go @@ -1,7 +1,6 @@ package cmd import ( - "context" "fmt" "github.com/exoscale/cli/pkg/globalstate" "github.com/spf13/cobra" @@ -37,7 +36,7 @@ func (c *dbaasAclCreateCmd) cmdPreRun(cmd *cobra.Command, args []string) error { // Main run logic for showing ACL details func (c *dbaasAclCreateCmd) cmdRun(cmd *cobra.Command, args []string) error { - ctx := context.Background() + ctx := gContext // Validate required inputs if c.Name == "" || c.Username == "" || c.ServiceType == "" || c.Permission == "" || c.Pattern == "" { diff --git a/cmd/dbaas_acl_delete.go b/cmd/dbaas_acl_delete.go index e7a4504c..8d613936 100644 --- a/cmd/dbaas_acl_delete.go +++ b/cmd/dbaas_acl_delete.go @@ -1,7 +1,6 @@ package cmd import ( - "context" "fmt" "github.com/exoscale/cli/pkg/globalstate" @@ -34,7 +33,7 @@ func (c *dbaasAclDeleteCmd) cmdPreRun(cmd *cobra.Command, args []string) error { // Main run logic for showing ACL details func (c *dbaasAclDeleteCmd) cmdRun(cmd *cobra.Command, args []string) error { - ctx := context.Background() + ctx := gContext // Validate required flags if c.Name == "" || c.ServiceType == "" || c.Username == "" { diff --git a/cmd/dbaas_acl_list.go b/cmd/dbaas_acl_list.go index ea4d47b2..ad93bd54 100644 --- a/cmd/dbaas_acl_list.go +++ b/cmd/dbaas_acl_list.go @@ -1,7 +1,6 @@ package cmd import ( - "context" "fmt" "github.com/spf13/cobra" @@ -35,7 +34,7 @@ func (c *dbaasAclListCmd) cmdPreRun(cmd *cobra.Command, args []string) error { // Main run logic for listing ACLs func (c *dbaasAclListCmd) cmdRun(cmd *cobra.Command, args []string) error { - ctx := context.Background() + ctx := gContext // Validate required flags if c.Name == "" || c.ServiceType == "" { diff --git a/cmd/dbaas_acl_update.go b/cmd/dbaas_acl_update.go index 61b020b9..39cf5708 100644 --- a/cmd/dbaas_acl_update.go +++ b/cmd/dbaas_acl_update.go @@ -1,7 +1,6 @@ package cmd import ( - "context" "fmt" "github.com/exoscale/cli/pkg/globalstate" "github.com/spf13/cobra" @@ -38,7 +37,7 @@ func (c *dbaasAclUpdateCmd) cmdPreRun(cmd *cobra.Command, args []string) error { // Main run logic for showing ACL details func (c *dbaasAclUpdateCmd) cmdRun(cmd *cobra.Command, args []string) error { - ctx := context.Background() + ctx := gContext // Validate required flags if c.Name == "" || c.Username == "" || c.ServiceType == "" {