From ee24b3a82d25cda2e69e712512c095565ed64dd6 Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Wed, 13 Nov 2019 09:33:31 -0500 Subject: [PATCH] getter: allow the gcs download scheme --- client/allocrunner/taskrunner/getter/getter.go | 2 +- client/allocrunner/taskrunner/getter/getter_test.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/client/allocrunner/taskrunner/getter/getter.go b/client/allocrunner/taskrunner/getter/getter.go index a7698d9b74a..c896d6f9292 100644 --- a/client/allocrunner/taskrunner/getter/getter.go +++ b/client/allocrunner/taskrunner/getter/getter.go @@ -18,7 +18,7 @@ var ( lock sync.Mutex // supported is the set of download schemes supported by Nomad - supported = []string{"http", "https", "s3", "hg", "git"} + supported = []string{"http", "https", "s3", "hg", "git", "gcs"} ) const ( diff --git a/client/allocrunner/taskrunner/getter/getter_test.go b/client/allocrunner/taskrunner/getter/getter_test.go index ef961bbc129..2816be10b1e 100644 --- a/client/allocrunner/taskrunner/getter/getter_test.go +++ b/client/allocrunner/taskrunner/getter/getter_test.go @@ -342,6 +342,13 @@ func TestGetGetterUrl_Queries(t *testing.T) { }, output: "bucket.s3-eu-west-1.amazonaws.com/foo/bar?aws_access_key_id=abcd1234", }, + { + name: "gcs", + artifact: &structs.TaskArtifact{ + GetterSource: "gcs::https://www.googleapis.com/storage/v1/b/d/f", + }, + output: "gcs::https://www.googleapis.com/storage/v1/b/d/f", + }, { name: "local file", artifact: &structs.TaskArtifact{