Skip to content

Commit

Permalink
added option to build using a version flag for user-agent (#35)
Browse files Browse the repository at this point in the history
* added option to build using a version flag for user-agent

* removed debug bin

* removed binary
  • Loading branch information
danielsinai authored Apr 17, 2023
1 parent debd295 commit 1120d12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode/
.env
.env
__debug_bin
3 changes: 2 additions & 1 deletion port/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/port-labs/terraform-provider-port-labs/port/cli"
"github.com/port-labs/terraform-provider-port-labs/version"
)

func Provider() *schema.Provider {
Expand Down Expand Up @@ -52,7 +53,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}
// token := d.Get("token").(string)
baseURL := d.Get("base_url").(string)

c, err := cli.New(baseURL, cli.WithHeader("User-Agent", "terraform-provider-port-labs/0.1"), cli.WithClientID(clientID))
c, err := cli.New(baseURL, cli.WithHeader("User-Agent", version.ProviderVersion), cli.WithClientID(clientID))
if err != nil {
return nil, diag.FromErr(err)
}
Expand Down
6 changes: 6 additions & 0 deletions version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package version

var (
// ProviderVersion is set during the release process to the release version of the binary
ProviderVersion = "terraform-provider-port-labs/0.1"
)

0 comments on commit 1120d12

Please sign in to comment.