Skip to content

Commit

Permalink
Remove /api/ tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabil-Lahssini committed Aug 16, 2023
1 parent 3d3f1d5 commit a5f5be7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ terraform {
}
provider "looker" {
base_url = "https://org.cloud.looker.com:19999/api/" # Optionally use env var LOOKER_BASE_URL
base_url = "https://org.cloud.looker.com:19999/api/" # Optionally use env var LOOKER_BASE_URL !!! use /api/ at the end of your url !!!
client_id = "xxxxxxxx" # Optionally use env var LOOKER_API_CLIENT_ID
client_secret = "xxxxxxxx" # Optionally use env var LOOKER_API_CLIENT_SECRET
}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.19
0.3.0
17 changes: 1 addition & 16 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
client := lookergo.NewClient(nil)
devClient := lookergo.NewClient(nil)

old_url := d.Get("base_url").(string)
var newURL string
if len(old_url) > 5 {
switch old_url[len(old_url)-4:] {
case "api/":
newURL = old_url
case ".com":
newURL = old_url + "/api/"
case "com/":
newURL = old_url + "api/"
case "/api":
newURL = old_url + "/"
}
} else {
newURL = old_url
}
newURL := d.Get("base_url").(string)

if err := client.SetBaseURL(newURL); err != nil {
diags = append(diags, diag.Diagnostic{
Expand Down

0 comments on commit a5f5be7

Please sign in to comment.