diff --git a/.goreleaser.yml b/.goreleaser.yml index f17c21d..8fe033f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -13,7 +13,7 @@ builds: flags: - -trimpath ldflags: - - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' + - '-s -w -X main.owner={{if eq .GitURL "https://github.com/rackn/terraform-provider-drp"}}rackn{{else}}digitalrebar{{end}} main.version={{.Version}} -X main.commit={{.Commit}}' goos: - freebsd - windows diff --git a/main.go b/main.go index 1dc7c44..40f8171 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,7 @@ package main import ( "context" "flag" + "fmt" "log" "github.com/hashicorp/terraform-plugin-framework/providerserver" @@ -24,6 +25,8 @@ var ( // to appropriate values for the compiled binary. version string = "dev" + owner string = "digitalrebar" + // goreleaser can pass other information to the main package, such as the specific commit // https://goreleaser.com/cookbooks/using-main.version/ ) @@ -35,7 +38,7 @@ func main() { flag.Parse() opts := providerserver.ServeOpts{ - Address: "registry.terraform.io/digitalrebar/drp", + Address: fmt.Sprintf("registry.terraform.io/%s/drp", owner), Debug: debug, }