-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Added enhaced user-agent header information
- Loading branch information
Showing
8 changed files
with
92 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,35 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin" | ||
"github.com/zscaler/terraform-provider-zpa/v3/zpa" | ||
"github.com/zscaler/terraform-provider-zpa/v3/zpa/common" | ||
) | ||
|
||
func main() { | ||
log.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime)) | ||
log.SetFlags(0) | ||
if len(os.Args) > 1 && os.Args[1] == "version" { | ||
fmt.Println(common.Version()) | ||
return | ||
} | ||
var debug bool | ||
if len(os.Args) > 1 && os.Args[1] == "debug" { | ||
debug = true | ||
} | ||
log.Printf(`ZPA Terraform Provider | ||
Version %s | ||
https://registry.terraform.io/providers/zscaler/zpa/latest/docs | ||
`, common.Version()) | ||
plugin.Serve(&plugin.ServeOpts{ | ||
ProviderFunc: zpa.Provider}) | ||
ProviderFunc: zpa.ZPAProvider, | ||
ProviderAddr: "registry.terraform.io/zscaler/zpa", | ||
Debug: debug, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package common | ||
|
||
import "context" | ||
|
||
var ( | ||
version = "3.0.2" | ||
// ResourceName is resource name without databricks_ prefix | ||
ResourceName contextKey = 1 | ||
// Provider is the current instance of provider | ||
Provider contextKey = 2 | ||
// Current is the current name of integration test | ||
Current contextKey = 3 | ||
// If current resource is data | ||
IsData contextKey = 4 | ||
// apiVersion | ||
Api contextKey = 5 | ||
) | ||
|
||
type contextKey int | ||
|
||
func (k contextKey) GetOrUnknown(ctx context.Context) string { | ||
rn, ok := ctx.Value(k).(string) | ||
if !ok { | ||
return "unknown" | ||
} | ||
return rn | ||
} | ||
|
||
// Version returns version of provider | ||
func Version() string { | ||
return version | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters