Skip to content

Commit

Permalink
fix: fixes #12 correctly setting up a custom ionos api url
Browse files Browse the repository at this point in the history
  • Loading branch information
Florin Mihalache committed Jun 11, 2021
1 parent 5956373 commit af08d8c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions ionoscloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/httpclient"
"log"
"strings"
"time"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
Expand Down Expand Up @@ -129,13 +128,7 @@ func providerConfigure(d *schema.ResourceData, terraformVersion string) (interfa

newConfig := ionoscloud.NewConfiguration(username.(string), password.(string), token.(string))
if len(cleanedUrl) > 0 {
parts := strings.Split(cleanedUrl, "://")
if len(parts) == 1 {
newConfig.Host = cleanedUrl
} else {
newConfig.Scheme = parts[1]
newConfig.Host = parts[2]
}
newConfig.Servers[0].URL = cleanedUrl
}
newConfig.UserAgent = httpclient.TerraformUserAgent(terraformVersion)
newClient := ionoscloud.NewAPIClient(newConfig)
Expand Down

0 comments on commit af08d8c

Please sign in to comment.