Skip to content
Draft
Show file tree
Hide file tree
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 git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func TestCloneRepoSSH(t *testing.T) {
t.Parallel()

tmpDir := t.TempDir()
srvFS := osfs.New(tmpDir, osfs.WithChrootOS())
srvFS := osfs.New(tmpDir, osfs.WithBoundOS())

_ = gittest.NewRepo(t, srvFS, gittest.Commit(t, "README.md", "Hello, world!", "Wow!"))
key := randKeygen(t)
Expand Down Expand Up @@ -310,7 +310,7 @@ func TestCloneRepoSSH(t *testing.T) {
t.Parallel()

tmpDir := t.TempDir()
srvFS := osfs.New(tmpDir, osfs.WithChrootOS())
srvFS := osfs.New(tmpDir, osfs.WithBoundOS())

_ = gittest.NewRepo(t, srvFS, gittest.Commit(t, "README.md", "Hello, world!", "Wow!"))
key := randKeygen(t)
Expand Down Expand Up @@ -341,7 +341,7 @@ func TestCloneRepoSSH(t *testing.T) {
t.Parallel()

tmpDir := t.TempDir()
srvFS := osfs.New(tmpDir, osfs.WithChrootOS())
srvFS := osfs.New(tmpDir, osfs.WithBoundOS())

_ = gittest.NewRepo(t, srvFS, gittest.Commit(t, "README.md", "Hello, world!", "Wow!"))
key := randKeygen(t)
Expand Down
306 changes: 168 additions & 138 deletions go.mod

Large diffs are not rendered by default.

1,064 changes: 599 additions & 465 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ func TestGitSSHAuth(t *testing.T) {
require.NotNil(t, signer)

tmpDir := t.TempDir()
srvFS := osfs.New(tmpDir, osfs.WithChrootOS())
srvFS := osfs.New(tmpDir, osfs.WithBoundOS())

_ = gittest.NewRepo(t, srvFS, gittest.Commit(t, "Dockerfile", "FROM "+testImageAlpine, "Initial commit"))
tr := gittest.NewServerSSH(t, srvFS, signer.PublicKey())
Expand All @@ -495,7 +495,7 @@ func TestGitSSHAuth(t *testing.T) {
require.NotNil(t, signer)

tmpDir := t.TempDir()
srvFS := osfs.New(tmpDir, osfs.WithChrootOS())
srvFS := osfs.New(tmpDir, osfs.WithBoundOS())

_ = gittest.NewRepo(t, srvFS, gittest.Commit(t, "Dockerfile", "FROM "+testImageAlpine, "Initial commit"))
tr := gittest.NewServerSSH(t, srvFS, signer.PublicKey())
Expand Down
8 changes: 3 additions & 5 deletions log/coder.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"sync"
"time"

"cdr.dev/slog"
"cdr.dev/slog/sloggers/sloghuman"
"cdr.dev/slog/v3"
"cdr.dev/slog/v3/sloggers/sloghuman"
"github.com/coder/coder/v2/agent/proto"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
Expand Down Expand Up @@ -89,9 +89,7 @@ type coderLogSender interface {
}

func initClient(coderURL *url.URL, token string) *agentsdk.Client {
client := agentsdk.New(coderURL)
client.SetSessionToken(token)
return client
return agentsdk.New(coderURL, agentsdk.WithFixedToken(token))
}

func initRPC(ctx context.Context, client *agentsdk.Client, l slog.Logger) (proto.DRPCAgentClient20, error) {
Expand Down
2 changes: 1 addition & 1 deletion log/coder_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"testing"
"time"

"cdr.dev/slog/sloggers/slogtest"
"cdr.dev/slog/v3/sloggers/slogtest"
"github.com/coder/coder/v2/agent/proto"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
Expand Down
5 changes: 5 additions & 0 deletions options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,4 +693,9 @@ func UnsetEnv() {
// Unset the Kaniko environment variable which we set it in the
// Dockerfile to ensure correct behavior during building.
_ = os.Unsetenv("KANIKO_DIR")

// dd-trace-go (imported transitively via codersdk) sets this at init
// to propagate a per-process session ID to child processes. It must not
// leak into the workspace environment.
_ = os.Unsetenv("_DD_ROOT_GO_SESSION_ID")
}
Loading