cloud/shepherd: move ssh client to own package
Change-Id: I56ad16f8f2f355243c5c0414656bbfbbff1faef5
Reviewed-on: https://review.monogon.dev/c/monogon/+/2791
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/cloud/shepherd/manager/fake_ssh_client.go b/cloud/shepherd/manager/fake_ssh_client.go
index 1d9d371..db13b5b 100644
--- a/cloud/shepherd/manager/fake_ssh_client.go
+++ b/cloud/shepherd/manager/fake_ssh_client.go
@@ -5,20 +5,23 @@
"crypto/ed25519"
"crypto/rand"
"fmt"
+ "io"
"time"
"google.golang.org/protobuf/proto"
apb "source.monogon.dev/cloud/agent/api"
+
+ "source.monogon.dev/go/net/ssh"
)
-// FakeSSHClient is an SSHClient that pretends to start an agent, but in reality
+// FakeSSHClient is an Client that pretends to start an agent, but in reality
// just responds with what an agent would respond on every execution attempt.
type FakeSSHClient struct{}
type fakeSSHConnection struct{}
-func (f *FakeSSHClient) Dial(ctx context.Context, address string, timeout time.Duration) (SSHConnection, error) {
+func (f *FakeSSHClient) Dial(ctx context.Context, address string, timeout time.Duration) (ssh.Connection, error) {
return &fakeSSHConnection{}, nil
}
@@ -46,7 +49,7 @@
return arspb, nil, nil
}
-func (f *fakeSSHConnection) Upload(ctx context.Context, targetPath string, data []byte) error {
+func (f *fakeSSHConnection) Upload(ctx context.Context, targetPath string, _ io.Reader) error {
if targetPath != "/fake/path" {
return fmt.Errorf("unexpected target path in test")
}