Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: Rename "CODER_URL" to "CODER_AGENT_URL" #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ func New() *schema.Provider {
Type: schema.TypeString,
Description: "The URL to access Coder.",
Optional: true,
// The "CODER_URL" environment variable is used by default
// The "CODER_AGENT_URL" environment variable is used by default
// as the Access URL when generating scripts.
DefaultFunc: schema.EnvDefaultFunc("CODER_URL", "https://mydeployment.coder.com"),
DefaultFunc: schema.EnvDefaultFunc("CODER_AGENT_URL", "https://mydeployment.coder.com"),
ValidateFunc: func(i interface{}, s string) ([]string, []error) {
_, err := url.Parse(s)
if err != nil {
Expand All @@ -44,7 +44,7 @@ func New() *schema.Provider {
return nil, diag.Errorf("unexpected type %q for url", reflect.TypeOf(resourceData.Get("url")).String())
}
if rawURL == "" {
return nil, diag.Errorf("CODER_URL must not be empty; got %q", rawURL)
return nil, diag.Errorf("CODER_AGENT_URL must not be empty; got %q", rawURL)
}
parsed, err := url.Parse(resourceData.Get("url").(string))
if err != nil {
Expand Down