backend/remote: fix symlink issues and Windows support

The issues with uploading configurations are fixed in our dependencies, but we need these changes to make things work again with those updated dependencies.
pull/19573/head
Sander van Harmelen 8 years ago
parent 98c70e67bf
commit 2db49493ff

@ -2,6 +2,7 @@ package atlas
import (
"bytes"
"context"
"crypto/md5"
"crypto/tls"
"crypto/x509"
@ -231,7 +232,7 @@ func (c *stateClient) http() (*retryablehttp.Client, error) {
}
rc := retryablehttp.NewClient()
rc.CheckRetry = func(resp *http.Response, err error) (bool, error) {
rc.CheckRetry = func(ctx context.Context, resp *http.Response, err error) (bool, error) {
if err != nil {
// don't bother retrying if the certs don't match
if err, ok := err.(*url.Error); ok {
@ -242,7 +243,7 @@ func (c *stateClient) http() (*retryablehttp.Client, error) {
// continue retrying
return true, nil
}
return retryablehttp.DefaultRetryPolicy(resp, err)
return retryablehttp.DefaultRetryPolicy(ctx, resp, err)
}
t := cleanhttp.DefaultTransport()

@ -2,6 +2,7 @@ package atlas
import (
"bytes"
"context"
"crypto/md5"
"crypto/tls"
"crypto/x509"
@ -74,12 +75,12 @@ func TestStateClient_noRetryOnBadCerts(t *testing.T) {
// Instrument CheckRetry to make sure we didn't retry
retries := 0
oldCheck := httpClient.CheckRetry
httpClient.CheckRetry = func(resp *http.Response, err error) (bool, error) {
httpClient.CheckRetry = func(ctx context.Context, resp *http.Response, err error) (bool, error) {
if retries > 0 {
t.Fatal("retried after certificate error")
}
retries++
return oldCheck(resp, err)
return oldCheck(ctx, resp, err)
}
_, err = client.Get()

@ -322,6 +322,10 @@ func (m *mockOrganizations) Capacity(ctx context.Context, name string) (*tfe.Cap
return &tfe.Capacity{Pending: pending, Running: running}, nil
}
func (m *mockOrganizations) Entitlements(ctx context.Context, name string) (*tfe.Entitlements, error) {
panic("not implemented")
}
func (m *mockOrganizations) RunQueue(ctx context.Context, name string, options tfe.RunQueueOptions) (*tfe.RunQueue, error) {
rq := &tfe.RunQueue{}
@ -979,6 +983,10 @@ func (m *mockWorkspaces) Unlock(ctx context.Context, workspaceID string) (*tfe.W
return w, nil
}
func (m *mockWorkspaces) ForceUnlock(ctx context.Context, workspaceID string) (*tfe.Workspace, error) {
panic("not implemented")
}
func (m *mockWorkspaces) AssignSSHKey(ctx context.Context, workspaceID string, options tfe.WorkspaceAssignSSHKeyOptions) (*tfe.Workspace, error) {
panic("not implemented")
}

Loading…
Cancel
Save