feat: Remove magical parameters from being injected (#371)

* ci: Update DataDog GitHub branch to fallback to GITHUB_REF

This was detecting branches, but not our "main" branch before.
Hopefully this fixes it!

* Add basic Terraform Provider

* Rename post files to upload

* Add tests for resources

* Skip instance identity test

* Add tests for ensuring agent get's passed through properly

* Fix linting errors

* Add echo path

* Fix agent authentication

* fix: Convert all jobs to use a common resource and agent type

This enables a consistent API for project import and provisioned resources.

* Add "coder_workspace" data source

* feat: Remove magical parameters from being injected

This is a much cleaner abstraction. Explicitly declaring the user
parameters for each provisioner makes for significantly simpler
testing.
This commit is contained in:
Kyle Carberry
2022-02-28 12:26:01 -06:00
committed by GitHub
parent bd0293aff9
commit e5c95552cd
19 changed files with 571 additions and 323 deletions

View File

@ -3,7 +3,9 @@ package codersdk
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/url"
"github.com/coder/coder/coderd"
)
@ -26,3 +28,8 @@ func (c *Client) UploadFile(ctx context.Context, contentType string, content []b
var resp coderd.UploadFileResponse
return resp, json.NewDecoder(res.Body).Decode(&resp)
}
// DownloadURL returns
func (c *Client) DownloadURL(asset string) (*url.URL, error) {
return c.URL.Parse(fmt.Sprintf("/api/v2/downloads/%s", asset))
}