Skip to content

Commit

Permalink
set region in client
Browse files Browse the repository at this point in the history
  • Loading branch information
uzaxirr committed Feb 23, 2024
1 parent eae4392 commit 851c2b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/database/database_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ var dbVersionListCmd = &cobra.Command{
Example: `civo db versions`,
Short: "List all the available database versions",
Run: func(cmd *cobra.Command, args []string) {
utility.EnsureCurrentRegion()

client, err := config.CivoAPIClient()
if err != nil {
utility.Error("Creating the connection to Civo's API failed with %s", err)
os.Exit(1)
}

if common.RegionSet != "" {
client.Region = common.RegionSet
}

dbVersions, err := client.ListDBVersions()
if err != nil {
utility.Error("%s", err)
Expand Down

0 comments on commit 851c2b7

Please sign in to comment.