Skip to content

Commit

Permalink
Merge pull request #45 from denopink/denopink/patch/rename-env-vars-a…
Browse files Browse the repository at this point in the history
…nd-build-for-all-langs

patch: rename env vars and build all langs
  • Loading branch information
schmidtw committed Oct 18, 2023
2 parents ae9ba17 + 1255ba3 commit c3f403b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ jobs:
goversion:
- 1.20.x
language:
# - nodejs
# - python
# - dotnet
- nodejs
- python
- dotnet
- go
nodeversion:
- 16.x
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ The VRA Resource Provider lets you manage [VRA](https://www.vmware.com/products/

The following configurations are overridable via env vars:

- access_token (access token for API operations) with env var VMWARE_VRA_ACCESS_TOKEN
- refresh_token (refresh token for API operations) with env var VMWARE_VRA_REFRESH_TOKEN
- url (base url for API operations) with env var VMWARE_VRA_URL
- reauthorizeTimeout (timeout for how often to reauthorize the access token) with env var VMWARE_VRA_REAUTHORIZE_TIMEOUT
- access_token (access token for API operations) with env var VRA_ACCESS_TOKEN
- refresh_token (refresh token for API operations) with env var VRA_REFRESH_TOKEN
- url (base url for API operations) with env var VRA_URL
- reauthorizeTimeout (timeout for how often to reauthorize the access token) with env var VRA7_REAUTHORIZE_TIMEOUT

## Installing

Expand Down
16 changes: 8 additions & 8 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,26 @@ func Provider() tfbridge.ProviderInfo {
cf := vraP.ConfigureFunc
vraP.ConfigureFunc = func(d *schema.ResourceData) (interface{}, error) {
// override vra configuration cache, cache includes
// - access_token (access token for API operations) with env var VMWARE_VRA_ACCESS_TOKEN
// - refresh_token (refresh token for API operations) with env var VMWARE_VRA_REFRESH_TOKEN
// - url (base url for API operations) with env var VMWARE_VRA_URL
// - reauthorizeTimeout (timeout for how often to reauthorize the access token) with env var VMWARE_VRA_REAUTHORIZE_TIMEOUT
envAccessToken := os.Getenv("VMWARE_VRA_ACCESS_TOKEN")
// - access_token (access token for API operations) with env var VRA_ACCESS_TOKEN
// - refresh_token (refresh token for API operations) with env var VRA_REFRESH_TOKEN
// - url (base url for API operations) with env var VRA_URL
// - reauthorizeTimeout (timeout for how often to reauthorize the access token) with env var VRA7_REAUTHORIZE_TIMEOUT
envAccessToken := os.Getenv("VRA_ACCESS_TOKEN")
if len(envAccessToken) != 0 {
d.Set("access_token", envAccessToken)
}

envRefreshToken := os.Getenv("VMWARE_VRA_REFRESH_TOKEN")
envRefreshToken := os.Getenv("VRA_REFRESH_TOKEN")
if len(envRefreshToken) != 0 {
d.Set("refresh_token", envRefreshToken)
}

envURL := os.Getenv("VMWARE_VRA_URL")
envURL := os.Getenv("VRA_URL")
if len(envURL) != 0 {
d.Set("url", envURL)
}

envReauthorizeTimeout := os.Getenv("VMWARE_VRA_REAUTHORIZE_TIMEOUT")
envReauthorizeTimeout := os.Getenv("VRA7_REAUTHORIZE_TIMEOUT")
if len(envReauthorizeTimeout) != 0 {
d.Set("reauthorize_timeout", envReauthorizeTimeout)
}
Expand Down
8 changes: 4 additions & 4 deletions sdk/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ The VRA Resource Provider lets you manage [VRA](https://www.vmware.com/products/

The following configurations are overridable via env vars:

- access_token (access token for API operations) with env var VMWARE_VRA_ACCESS_TOKEN
- refresh_token (refresh token for API operations) with env var VMWARE_VRA_REFRESH_TOKEN
- url (base url for API operations) with env var VMWARE_VRA_URL
- reauthorizeTimeout (timeout for how often to reauthorize the access token) with env var VMWARE_VRA_REAUTHORIZE_TIMEOUT
- access_token (access token for API operations) with env var VRA_ACCESS_TOKEN
- refresh_token (refresh token for API operations) with env var VRA_REFRESH_TOKEN
- url (base url for API operations) with env var VRA_URL
- reauthorizeTimeout (timeout for how often to reauthorize the access token) with env var VRA7_REAUTHORIZE_TIMEOUT

## Installing

Expand Down

0 comments on commit c3f403b

Please sign in to comment.