Skip to content

Commit

Permalink
using global context.
Browse files Browse the repository at this point in the history
  • Loading branch information
elkezza committed Jan 2, 2025
1 parent f0cdd7f commit dba696d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions cmd/dbaas_acl_create.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"context"
"fmt"
"github.com/exoscale/cli/pkg/globalstate"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -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 == "" {
Expand Down
3 changes: 1 addition & 2 deletions cmd/dbaas_acl_delete.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"context"
"fmt"

"github.com/exoscale/cli/pkg/globalstate"
Expand Down Expand Up @@ -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 == "" {
Expand Down
3 changes: 1 addition & 2 deletions cmd/dbaas_acl_list.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"context"
"fmt"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -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 == "" {
Expand Down
3 changes: 1 addition & 2 deletions cmd/dbaas_acl_update.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"context"
"fmt"
"github.com/exoscale/cli/pkg/globalstate"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -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 == "" {
Expand Down

0 comments on commit dba696d

Please sign in to comment.