diff options
| author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-12-06 12:31:31 +0100 |
|---|---|---|
| committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-12-06 12:31:31 +0100 |
| commit | a7c243bb6d36684329fa8e9b96a95f2c22ba81e5 (patch) | |
| tree | a760fef0c9c99afd9752dbbc902308df67a0a011 /go/cmd | |
| parent | 46f0594457d805ae43b509c38cc5bb95ef76f4c9 (diff) | |
| download | gitlab-shell-a7c243bb6d36684329fa8e9b96a95f2c22ba81e5.tar.gz | |
Upgrade gitaly Client dependency
The client now has TLS support. So this gets pulled into this component.
To make it work, we have to upgrade the proto too.
Diffstat (limited to 'go/cmd')
| -rw-r--r-- | go/cmd/gitaly-receive-pack/main.go | 5 | ||||
| -rw-r--r-- | go/cmd/gitaly-upload-archive/main.go | 7 | ||||
| -rw-r--r-- | go/cmd/gitaly-upload-archive/main_test.go | 6 | ||||
| -rw-r--r-- | go/cmd/gitaly-upload-pack/main.go | 5 |
4 files changed, 10 insertions, 13 deletions
diff --git a/go/cmd/gitaly-receive-pack/main.go b/go/cmd/gitaly-receive-pack/main.go index 511d584..06b8a72 100644 --- a/go/cmd/gitaly-receive-pack/main.go +++ b/go/cmd/gitaly-receive-pack/main.go @@ -5,10 +5,9 @@ import ( "fmt" "os" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab-shell/go/internal/handler" "gitlab.com/gitlab-org/gitlab-shell/go/internal/logger" - - pb "gitlab.com/gitlab-org/gitaly-proto/go" ) func init() { @@ -24,7 +23,7 @@ func main() { logger.Fatal("wrong number of arguments", fmt.Errorf("expected 2 arguments, got %v", os.Args)) } - var request pb.SSHReceivePackRequest + var request gitalypb.SSHReceivePackRequest if err := json.Unmarshal([]byte(os.Args[2]), &request); err != nil { logger.Fatal("unmarshaling request json failed", err) } diff --git a/go/cmd/gitaly-upload-archive/main.go b/go/cmd/gitaly-upload-archive/main.go index c988baa..845f8f4 100644 --- a/go/cmd/gitaly-upload-archive/main.go +++ b/go/cmd/gitaly-upload-archive/main.go @@ -5,17 +5,16 @@ import ( "fmt" "os" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab-shell/go/internal/handler" "gitlab.com/gitlab-org/gitlab-shell/go/internal/logger" - - pb "gitlab.com/gitlab-org/gitaly-proto/go" ) func init() { logger.ProgName = "gitaly-upload-archive" } -type uploadArchiveHandler func(gitalyAddress string, request *pb.SSHUploadArchiveRequest) (int32, error) +type uploadArchiveHandler func(gitalyAddress string, request *gitalypb.SSHUploadArchiveRequest) (int32, error) func main() { if err := handler.Prepare(); err != nil { @@ -36,7 +35,7 @@ func uploadArchive(handler uploadArchiveHandler, args []string) (int32, error) { return 0, fmt.Errorf("wrong number of arguments: expected 2 arguments, got %v", args) } - var request pb.SSHUploadArchiveRequest + var request gitalypb.SSHUploadArchiveRequest if err := json.Unmarshal([]byte(args[2]), &request); err != nil { return 0, fmt.Errorf("unmarshaling request json failed: %v", err) } diff --git a/go/cmd/gitaly-upload-archive/main_test.go b/go/cmd/gitaly-upload-archive/main_test.go index b17da7b..7cb9942 100644 --- a/go/cmd/gitaly-upload-archive/main_test.go +++ b/go/cmd/gitaly-upload-archive/main_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - pb "gitlab.com/gitlab-org/gitaly-proto/go" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" ) var testGitalyAddress = "unix:gitaly.socket" @@ -13,7 +13,7 @@ var testGitalyAddress = "unix:gitaly.socket" func TestUploadArchiveSuccess(t *testing.T) { testRelativePath := "myrepo.git" requestJSON := fmt.Sprintf(`{"repository":{"relative_path":"%s"}}`, testRelativePath) - mockHandler := func(gitalyAddress string, request *pb.SSHUploadArchiveRequest) (int32, error) { + mockHandler := func(gitalyAddress string, request *gitalypb.SSHUploadArchiveRequest) (int32, error) { if gitalyAddress != testGitalyAddress { t.Fatalf("Expected gitaly address %s got %v", testGitalyAddress, gitalyAddress) } @@ -35,7 +35,7 @@ func TestUploadArchiveSuccess(t *testing.T) { } func TestUploadArchiveFailure(t *testing.T) { - mockHandler := func(_ string, _ *pb.SSHUploadArchiveRequest) (int32, error) { + mockHandler := func(_ string, _ *gitalypb.SSHUploadArchiveRequest) (int32, error) { t.Fatal("Expected handler not to be called") return 0, nil diff --git a/go/cmd/gitaly-upload-pack/main.go b/go/cmd/gitaly-upload-pack/main.go index 282c90f..a2250b2 100644 --- a/go/cmd/gitaly-upload-pack/main.go +++ b/go/cmd/gitaly-upload-pack/main.go @@ -5,10 +5,9 @@ import ( "fmt" "os" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab-shell/go/internal/handler" "gitlab.com/gitlab-org/gitlab-shell/go/internal/logger" - - pb "gitlab.com/gitlab-org/gitaly-proto/go" ) func init() { @@ -24,7 +23,7 @@ func main() { logger.Fatal("wrong number of arguments", fmt.Errorf("expected 2 arguments, got %v", os.Args)) } - var request pb.SSHUploadPackRequest + var request gitalypb.SSHUploadPackRequest if err := json.Unmarshal([]byte(os.Args[2]), &request); err != nil { logger.Fatal("unmarshaling request json failed", err) } |
