diff --git a/README.md b/README.md
index 97d805a0..19322180 100644
--- a/README.md
+++ b/README.md
@@ -103,15 +103,27 @@ The tracker files can still be built separately using `bazel build //some:label
### Remote Storage
So far, only Google Cloud Storage is supported for remote storage.
-To start using a remote storage backend, add a `bucket` attribute to `snapshots` in your root BUILD file:
+To start using a remote storage backend, add a `storage` attribute to `snapshots`
+in your root BUILD file:
```skylark
snapshots(
name = "snapshots",
- bucket = "name-of-cloud-storage-bucket",
+ storage = "gcs://name/of/the/storage?credential=env&project_id=env",
)
```
+Google Cloud Storage requires `credential` and `project_id` fields to be exists in the storage url.
+You can set both values to env in order to use the default credentials and automatically infer the project ID.
+
+> :warning: **Make sure to provide full path of the storage.** Each supported backend has their own
+set of variables that you can find in the below table.
+
+Backend | Variables | Values
+---|---|---
+Google Cloud Storage | `credential`
`project_id` | `env` _or_ `"~/path/to/credential.json"`
`env` _or_ `"project_id"`
+
+
Bazel Snapshots will create the following structure in the remote storage:
```
@@ -156,6 +168,7 @@ $ bazel run snapshots -- get latest
$ bazel run snaptool -- diff latest
```
+
### Using in Continous Deployment Jobs
A minimal setup would have a deployment process (CD) which collects a snapshot and compares it with some already-known snapshot in order to find out which targets need to be re-deployed.
diff --git a/deps.bzl b/deps.bzl
index d1f5c10c..731324c1 100644
--- a/deps.bzl
+++ b/deps.bzl
@@ -124,6 +124,14 @@ def go_dependencies():
sum = "h1:zH8ljVhhq7yC0MIeUL/IviMtY8hx2mK8cN9wEYb8ggw=",
version = "v0.0.0-20211011173535-cb28da3451f1",
)
+ go_repository(
+ name = "com_github_cpuguy83_go_md2man_v2",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/cpuguy83/go-md2man/v2",
+ sum = "h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=",
+ version = "v2.0.0-20190314233015-f79a8a8ca69d",
+ )
+
go_repository(
name = "com_github_creack_pty",
build_file_proto_mode = "disable_global",
@@ -131,6 +139,41 @@ def go_dependencies():
sum = "h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w=",
version = "v1.1.9",
)
+ go_repository(
+ name = "com_github_dave_dst",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/dave/dst",
+ sum = "h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY=",
+ version = "v0.26.2",
+ )
+ go_repository(
+ name = "com_github_dave_gopackages",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/dave/gopackages",
+ sum = "h1:l99YKCdrK4Lvb/zTupt0GMPfNbncAGf8Cv/t1sYLOg0=",
+ version = "v0.0.0-20170318123100-46e7023ec56e",
+ )
+ go_repository(
+ name = "com_github_dave_jennifer",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/dave/jennifer",
+ sum = "h1:S15ZkFMRoJ36mGAQgWL1tnr0NQJh9rZ8qatseX/VbBc=",
+ version = "v1.2.0",
+ )
+ go_repository(
+ name = "com_github_dave_kerr",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/dave/kerr",
+ sum = "h1:xURkGi4RydhyaYR6PzcyHTueQudxY4LgxN1oYEPJHa0=",
+ version = "v0.0.0-20170318121727-bc25dd6abe8e",
+ )
+ go_repository(
+ name = "com_github_dave_rebecca",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/dave/rebecca",
+ sum = "h1:jxVfdOxRirbXL28vXMvUvJ1in3djwkVKXCq339qhBL0=",
+ version = "v0.9.1",
+ )
go_repository(
name = "com_github_davecgh_go_spew",
@@ -258,8 +301,8 @@ def go_dependencies():
name = "com_github_google_uuid",
build_file_proto_mode = "disable_global",
importpath = "github.com/google/uuid",
- sum = "h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=",
- version = "v1.1.2",
+ sum = "h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=",
+ version = "v1.3.0",
)
go_repository(
name = "com_github_googleapis_gax_go_v2",
@@ -268,6 +311,14 @@ def go_dependencies():
sum = "h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU=",
version = "v2.1.1",
)
+ go_repository(
+ name = "com_github_gopherjs_gopherjs",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/gopherjs/gopherjs",
+ sum = "h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=",
+ version = "v0.0.0-20181017120253-0766667cb4d1",
+ )
+
go_repository(
name = "com_github_grpc_ecosystem_grpc_gateway",
build_file_proto_mode = "disable_global",
@@ -297,6 +348,20 @@ def go_dependencies():
sum = "h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=",
version = "v0.9.1",
)
+ go_repository(
+ name = "com_github_jtolds_gls",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/jtolds/gls",
+ sum = "h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=",
+ version = "v4.20.0+incompatible",
+ )
+ go_repository(
+ name = "com_github_kevinburke_go_bindata",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/kevinburke/go-bindata",
+ sum = "h1:/JmqEhIWQ7GRScV0WjX/0tqBrC5D21ALg0H0U/KZ/ts=",
+ version = "v3.22.0+incompatible",
+ )
go_repository(
name = "com_github_kisielk_gotool",
@@ -350,6 +415,13 @@ def go_dependencies():
sum = "h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=",
version = "v1.2.2",
)
+ go_repository(
+ name = "com_github_pelletier_go_toml",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/pelletier/go-toml",
+ sum = "h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM=",
+ version = "v1.9.4",
+ )
go_repository(
name = "com_github_pmezard_go_difflib",
@@ -380,6 +452,48 @@ def go_dependencies():
sum = "h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk=",
version = "v1.3.0",
)
+ go_repository(
+ name = "com_github_russross_blackfriday_v2",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/russross/blackfriday/v2",
+ sum = "h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=",
+ version = "v2.0.1",
+ )
+ go_repository(
+ name = "com_github_sergi_go_diff",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/sergi/go-diff",
+ sum = "h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=",
+ version = "v1.0.0",
+ )
+ go_repository(
+ name = "com_github_shurcool_sanitized_anchor_name",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/shurcooL/sanitized_anchor_name",
+ sum = "h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=",
+ version = "v1.0.0",
+ )
+ go_repository(
+ name = "com_github_sirupsen_logrus",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/sirupsen/logrus",
+ sum = "h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=",
+ version = "v1.8.1",
+ )
+ go_repository(
+ name = "com_github_smartystreets_assertions",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/smartystreets/assertions",
+ sum = "h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=",
+ version = "v0.0.0-20180927180507-b2de0cb4f26d",
+ )
+ go_repository(
+ name = "com_github_smartystreets_goconvey",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/smartystreets/goconvey",
+ sum = "h1:lH+Snxmzl92r1jww8/jYPqKkhs3C9AF4LunzU56ZZr4=",
+ version = "v1.6.6",
+ )
go_repository(
name = "com_github_spaolacci_murmur3",
@@ -409,6 +523,34 @@ def go_dependencies():
sum = "h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=",
version = "v1.7.0",
)
+ go_repository(
+ name = "com_github_urfave_cli_v2",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/urfave/cli/v2",
+ sum = "h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=",
+ version = "v2.3.0",
+ )
+ go_repository(
+ name = "com_github_xuanwo_gg",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/Xuanwo/gg",
+ sum = "h1:axbZmA0qmidh3s9PA86GqvBXVQ3o7Bbpf0aImGtlimA=",
+ version = "v0.2.0",
+ )
+ go_repository(
+ name = "com_github_xuanwo_go_bufferpool",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/Xuanwo/go-bufferpool",
+ sum = "h1:DXzqJD9lJufXbT/03GrcEvYOs4gXYUj9/g5yi6Q9rUw=",
+ version = "v0.2.0",
+ )
+ go_repository(
+ name = "com_github_xuanwo_templateutils",
+ build_file_proto_mode = "disable_global",
+ importpath = "github.com/Xuanwo/templateutils",
+ sum = "h1:WpkWOqQtIQ2vAIpJLa727DdN8WtxhUkkbDGa6UhntJY=",
+ version = "v0.1.0",
+ )
go_repository(
name = "com_github_yuin_goldmark",
@@ -490,6 +632,13 @@ def go_dependencies():
sum = "h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=",
version = "v2.1.0",
)
+ go_repository(
+ name = "in_gopkg_src_d_go_billy_v4",
+ build_file_proto_mode = "disable_global",
+ importpath = "gopkg.in/src-d/go-billy.v4",
+ sum = "h1:KtlZ4c1OWbIs4jCv5ZXrTqG8EQocr0g/d4DjNg70aek=",
+ version = "v4.3.0",
+ )
go_repository(
name = "in_gopkg_yaml_v2",
@@ -505,6 +654,28 @@ def go_dependencies():
sum = "h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=",
version = "v3.0.0-20200313102051-9f266ea9e77c",
)
+ go_repository(
+ name = "io_beyondstorage_go_credential",
+ build_file_proto_mode = "disable_global",
+ importpath = "go.beyondstorage.io/credential",
+ sum = "h1:xJ7hBXmeUE0+rbW+RYZSz4KgHpXvc9g7oQ56f8dXdBk=",
+ version = "v1.0.0",
+ )
+ go_repository(
+ name = "io_beyondstorage_go_services_gcs_v3",
+ build_file_proto_mode = "disable_global",
+ importpath = "go.beyondstorage.io/services/gcs/v3",
+ sum = "h1:SPMTdsz6As4GSOuX/V8jPxz36qRXv12X7uSkyT7OOfM=",
+ version = "v3.0.0",
+ )
+ go_repository(
+ name = "io_beyondstorage_go_v5",
+ build_file_proto_mode = "disable_global",
+ importpath = "go.beyondstorage.io/v5",
+ sum = "h1:k9Axfgbt+oZXoDwSBVCl1XANHSL4rkNTGP2Lz9YdJe0=",
+ version = "v5.0.0",
+ )
+
go_repository(
name = "io_opencensus_go",
build_file_proto_mode = "disable_global",
@@ -582,6 +753,14 @@ def go_dependencies():
sum = "h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=",
version = "v1.27.1",
)
+ go_repository(
+ name = "org_golang_x_arch",
+ build_file_proto_mode = "disable_global",
+ importpath = "golang.org/x/arch",
+ sum = "h1:Vsc61gop4hfHdzQNolo6Fi/sw7TnJ2yl3ZR4i7bYirs=",
+ version = "v0.0.0-20180920145803-b19384d3c130",
+ )
+
go_repository(
name = "org_golang_x_crypto",
build_file_proto_mode = "disable_global",
diff --git a/go.mod b/go.mod
index e14c5f01..897ad780 100644
--- a/go.mod
+++ b/go.mod
@@ -3,12 +3,12 @@ module github.com/cognitedata/bazel-snapshots
go 1.17
require (
- cloud.google.com/go/storage v1.21.0
github.com/bazelbuild/rules_go v0.30.0
github.com/olekukonko/tablewriter v0.0.5
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
- google.golang.org/api v0.70.0
+ go.beyondstorage.io/services/gcs/v3 v3.0.0
+ go.beyondstorage.io/v5 v5.0.0
google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a
google.golang.org/grpc v1.44.0
)
@@ -17,20 +17,36 @@ require (
cloud.google.com/go v0.100.2 // indirect
cloud.google.com/go/compute v1.3.0 // indirect
cloud.google.com/go/iam v0.1.1 // indirect
+ cloud.google.com/go/storage v1.18.2 // indirect
+ github.com/Xuanwo/gg v0.2.0 // indirect
+ github.com/Xuanwo/go-bufferpool v0.2.0 // indirect
+ github.com/Xuanwo/templateutils v0.1.0 // indirect
+ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
+ github.com/dave/dst v0.26.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
+ github.com/kevinburke/go-bindata v3.22.0+incompatible // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
+ github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
+ github.com/russross/blackfriday/v2 v2.0.1 // indirect
+ github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
+ github.com/sirupsen/logrus v1.8.1 // indirect
+ github.com/urfave/cli/v2 v2.3.0 // indirect
+ go.beyondstorage.io/credential v1.0.0 // indirect
go.opencensus.io v0.23.0 // indirect
+ golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
golang.org/x/text v0.3.7 // indirect
+ golang.org/x/tools v0.1.5 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
+ google.golang.org/api v0.70.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
diff --git a/go.sum b/go.sum
index d37d6817..4c2b41b7 100644
--- a/go.sum
+++ b/go.sum
@@ -36,8 +36,6 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
-cloud.google.com/go/compute v1.2.0 h1:EKki8sSdvDU0OO9mAXGwPXOTOgPz2l08R0/IutDH11I=
-cloud.google.com/go/compute v1.2.0/go.mod h1:xlogom/6gr8RJGBe7nT2eGsQYAFUbbv8dbC29qE3Xmw=
cloud.google.com/go/compute v1.3.0 h1:mPL/MzDDYHsh5tHRS9mhmhWlcgClCrCa6ApQCU6wnHI=
cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
@@ -53,12 +51,18 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
-cloud.google.com/go/storage v1.21.0 h1:HwnT2u2D309SFDHQII6m18HlrCi3jAXhUMTLOWXYH14=
-cloud.google.com/go/storage v1.21.0/go.mod h1:XmRlxkgPjlBONznT2dDUU/5XlpU2OjMnKuqnZI01LAA=
+cloud.google.com/go/storage v1.18.2 h1:5NQw6tOn3eMm0oE8vTkfjau18kjL79FlMjy/CHTpmoY=
+cloud.google.com/go/storage v1.18.2/go.mod h1:AiIj7BWXyhO5gGVmYJ+S8tbkCx3yb0IMjua8Aw4naVM=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
+github.com/Xuanwo/gg v0.2.0 h1:axbZmA0qmidh3s9PA86GqvBXVQ3o7Bbpf0aImGtlimA=
+github.com/Xuanwo/gg v0.2.0/go.mod h1:0fLiiSxR87u2UA0ZNZiKZXuz3jnJdbDHWtU2xpdcH3s=
+github.com/Xuanwo/go-bufferpool v0.2.0 h1:DXzqJD9lJufXbT/03GrcEvYOs4gXYUj9/g5yi6Q9rUw=
+github.com/Xuanwo/go-bufferpool v0.2.0/go.mod h1:Mle++9GGouhOwGj52i9PJLNAPmW2nb8PWBP7JJzNCzk=
+github.com/Xuanwo/templateutils v0.1.0 h1:WpkWOqQtIQ2vAIpJLa727DdN8WtxhUkkbDGa6UhntJY=
+github.com/Xuanwo/templateutils v0.1.0/go.mod h1:OdE0DJ+CJxDBq6psX5DPV+gOZi8bhuHuVUpPCG++Wb8=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/bazelbuild/rules_go v0.30.0 h1:kX4jVcstqrsRqKPJSn2mq2o+TI21edRzEJSrEOMQtr0=
github.com/bazelbuild/rules_go v0.30.0/go.mod h1:MC23Dc/wkXEyk3Wpq6lCqz0ZAYOZDw2DR5y3N1q2i7M=
@@ -77,7 +81,15 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
+github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/dave/dst v0.26.2 h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY=
+github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU=
+github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ=
+github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg=
+github.com/dave/kerr v0.0.0-20170318121727-bc25dd6abe8e/go.mod h1:qZqlPyPvfsDJt+3wHJ1EvSXDuVjFTK0j2p/ca+gtsb8=
+github.com/dave/rebecca v0.9.1/go.mod h1:N6XYdMD/OKw3lkF3ywh8Z6wPGuwNFDNtWYEMFWEmXBA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -107,6 +119,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
+github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -149,6 +162,7 @@ github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIG
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ=
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
+github.com/google/pprof v0.0.0-20181127221834-b4f47329b966/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
@@ -165,11 +179,14 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
+github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
github.com/googleapis/gax-go/v2 v2.1.1 h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU=
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
+github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
@@ -177,6 +194,9 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
+github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
+github.com/kevinburke/go-bindata v3.22.0+incompatible h1:/JmqEhIWQ7GRScV0WjX/0tqBrC5D21ALg0H0U/KZ/ts=
+github.com/kevinburke/go-bindata v3.22.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
@@ -189,25 +209,46 @@ github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/Qd
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
+github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM=
+github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
+github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
+github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
+github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
+github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
+github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
+github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
+github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
+github.com/smartystreets/goconvey v1.6.6/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
+github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
+go.beyondstorage.io/credential v1.0.0 h1:xJ7hBXmeUE0+rbW+RYZSz4KgHpXvc9g7oQ56f8dXdBk=
+go.beyondstorage.io/credential v1.0.0/go.mod h1:7KAYievVw4a8u/eLZmnQt65Z91n84sMQj3LFbt8Xous=
+go.beyondstorage.io/services/gcs/v3 v3.0.0 h1:SPMTdsz6As4GSOuX/V8jPxz36qRXv12X7uSkyT7OOfM=
+go.beyondstorage.io/services/gcs/v3 v3.0.0/go.mod h1:4L+8y+igAsIPMwxdO03mjFN8BdsWkvuuLa723rGv64U=
+go.beyondstorage.io/v5 v5.0.0 h1:k9Axfgbt+oZXoDwSBVCl1XANHSL4rkNTGP2Lz9YdJe0=
+go.beyondstorage.io/v5 v5.0.0/go.mod h1:3wV9gCQnqu7tD/3LMeo2yimUKIeTSHpTc6wHSb0yY20=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
@@ -217,6 +258,7 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
+golang.org/x/arch v0.0.0-20180920145803-b19384d3c130/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -256,6 +298,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -309,6 +352,7 @@ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -323,6 +367,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -332,6 +377,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -368,10 +414,11 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -396,6 +443,7 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
@@ -424,6 +472,7 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
@@ -476,13 +525,12 @@ google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6
google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
+google.golang.org/api v0.58.0/go.mod h1:cAbP2FsxoGVNwtgNAmmn3y5G1TWAiVYRmg4yku3lv+E=
+google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU=
google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
google.golang.org/api v0.64.0/go.mod h1:931CdxA8Rm4t6zqTFGSsgwbAEZ2+GMYurbndwSimebM=
-google.golang.org/api v0.66.0/go.mod h1:I1dmXYpX7HGwz/ejRxwQp2qj5bFAz93HiCU1C1oYd9M=
google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g=
-google.golang.org/api v0.69.0 h1:yHW5s2SFyDapr/43kYtIQmoaaFVW4baLMLwqV4auj2A=
-google.golang.org/api v0.69.0/go.mod h1:boanBiw+h5c3s+tBPgEzLDRHfFLWV0qXxRHz3ws7C80=
google.golang.org/api v0.70.0 h1:67zQnAE0T2rB0A3CwLSas0K+SbVzSxP+zTLkQLexeiw=
google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
@@ -548,21 +596,18 @@ google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEc
google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211016002631-37fc39342514/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220111164026-67b88f271998/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20220114231437-d2e6a121cae0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20220201184016-50beb8ab5c44/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20220211171837-173942840c17/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
-google.golang.org/genproto v0.0.0-20220216160803-4663080d8bc8 h1:divpuJZKgX3Qt7MFDE5v62yu0yQcQbTCD9VJp9leX58=
-google.golang.org/genproto v0.0.0-20220216160803-4663080d8bc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
-google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c h1:TU4rFa5APdKTq0s6B7WTsH6Xmx0Knj86s6Biz56mErE=
google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a h1:uqouglH745GoGeZ1YFZbPBiu961tgi/9Qm5jaorajjQ=
google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
@@ -614,6 +659,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
diff --git a/snapshots/go/cmd/snapshots/BUILD.bazel b/snapshots/go/cmd/snapshots/BUILD.bazel
index ed44ee04..787d2378 100644
--- a/snapshots/go/cmd/snapshots/BUILD.bazel
+++ b/snapshots/go/cmd/snapshots/BUILD.bazel
@@ -19,10 +19,10 @@ go_library(
"//snapshots/go/pkg/bazel",
"//snapshots/go/pkg/config",
"//snapshots/go/pkg/models",
+ "//snapshots/go/pkg/storage",
"@com_github_olekukonko_tablewriter//:tablewriter",
"@com_github_spf13_pflag//:pflag",
- "@com_google_cloud_go_storage//:storage",
- "@org_golang_google_api//iterator",
+ "@io_beyondstorage_go_v5//types",
"@org_golang_google_grpc//:grpc",
],
)
diff --git a/snapshots/go/cmd/snapshots/collect.go b/snapshots/go/cmd/snapshots/collect.go
index 52a707d2..871901db 100644
--- a/snapshots/go/cmd/snapshots/collect.go
+++ b/snapshots/go/cmd/snapshots/collect.go
@@ -97,11 +97,11 @@ func runCollect(args []string) error {
return fmt.Errorf("failed to push snapshot: %w", err)
}
- objAttrs, err := obj.Attrs(ctx)
- if err != nil {
- return fmt.Errorf("failed to get snapshot attrs: %w", err)
+ contentLenght, isOk := obj.GetContentLength()
+ if !isOk {
+ log.Printf("failed to get contentLenght of pushed snapshot: %s", obj.Path)
}
- log.Printf("pushed snapshot of %d bytes: %s", objAttrs.Size, objAttrs.Name)
+ log.Printf("pushed snapshot of %d bytes: %s", contentLenght, obj.Path)
}
return nil
diff --git a/snapshots/go/cmd/snapshots/config.go b/snapshots/go/cmd/snapshots/config.go
index 8e5c76e2..83b56f2f 100644
--- a/snapshots/go/cmd/snapshots/config.go
+++ b/snapshots/go/cmd/snapshots/config.go
@@ -15,7 +15,7 @@ import (
// commonConfig holds common configuration for all commands; args which can
// always be passed.
type commonConfig struct {
- gcsBucket string
+ storageURL string
workspaceName string
verbose bool
}
@@ -31,7 +31,7 @@ func getCommonConfig(c *config.Config) *commonConfig {
func (*commonConfigurer) RegisterFlags(fs *flag.FlagSet, cmd string, c *config.Config) {
cc := &commonConfig{}
c.Exts[commonName] = cc
- fs.StringVar(&cc.gcsBucket, "gcs-bucket", "", "gcs bucket to store snapshots")
+ fs.StringVar(&cc.storageURL, "storage-url", "", "full orl of the storage")
fs.StringVar(&cc.workspaceName, "workspace-name", "", "name of bazel workspace")
fs.BoolVar(&cc.verbose, "verbose", false, "verbose output")
}
diff --git a/snapshots/go/cmd/snapshots/get.go b/snapshots/go/cmd/snapshots/get.go
index 81bc640f..46c8afa1 100644
--- a/snapshots/go/cmd/snapshots/get.go
+++ b/snapshots/go/cmd/snapshots/get.go
@@ -6,17 +6,19 @@ import (
"bytes"
"context"
"encoding/json"
+ "errors"
"fmt"
"io"
"io/ioutil"
"os"
+ "path"
+ "strings"
- "cloud.google.com/go/storage"
flag "github.com/spf13/pflag"
- "google.golang.org/api/iterator"
"github.com/cognitedata/bazel-snapshots/snapshots/go/pkg/config"
"github.com/cognitedata/bazel-snapshots/snapshots/go/pkg/models"
+ "github.com/cognitedata/bazel-snapshots/snapshots/go/pkg/storage"
)
type getConfig struct {
@@ -83,63 +85,62 @@ func runGet(args []string) error {
}
func get(ctx context.Context, gc *getConfig) (*models.Snapshot, error) {
- sclient, err := storage.NewClient(ctx)
+ store, err := storage.NewStorage(gc.storageURL)
if err != nil {
return nil, fmt.Errorf("failed to create client: %w", err)
}
- bucket := sclient.Bucket(gc.gcsBucket)
- var snapshotAttrs *storage.ObjectAttrs
+ snapshotBuffer := new(bytes.Buffer)
+ var snapshotName string
if !gc.skipTags {
- tagReader, err := bucket.Object(fmt.Sprintf("%s/tags/%s", gc.workspaceName, gc.name)).NewReader(ctx)
- if err != nil && err != storage.ErrObjectNotExist {
- return nil, fmt.Errorf("failed to look for tag %s: %w", gc.name, err)
- }
+ tagPath := fmt.Sprintf("%s/tags/%s", gc.workspaceName, gc.name)
+ tagBuffer := new(bytes.Buffer)
+ _, err := store.StatWithContext(ctx, tagPath)
if err == nil {
- snapshotName, err := ioutil.ReadAll(tagReader)
+ _, err = store.ReadWithContext(ctx, tagPath, tagBuffer)
+ if err != nil {
+ return nil, fmt.Errorf("failed to look for tag %s: %w", gc.name, err)
+ }
+ snapshotBytes, err := ioutil.ReadAll(tagBuffer)
if err != nil {
return nil, fmt.Errorf("failed to read tag: %w", err)
}
+ snapshotName = string(snapshotBytes)
- snapshotAttrs, err = bucket.Object(fmt.Sprintf("%s/snapshots/%s.json", gc.workspaceName, snapshotName)).Attrs(ctx)
+ _, err = store.ReadWithContext(ctx, fmt.Sprintf("%s/snapshots/%s.json", gc.workspaceName, snapshotName), snapshotBuffer)
if err != nil {
return nil, fmt.Errorf("failed to find resolved snapshot %s: %w", snapshotName, err)
}
}
}
- if !gc.skipNames && snapshotAttrs == nil {
- it := bucket.Objects(ctx, &storage.Query{
- Prefix: fmt.Sprintf("%s/snapshots/%s", gc.workspaceName, gc.name),
- })
- if attrs, err := it.Next(); err != nil && err != iterator.Done {
- return nil, fmt.Errorf("failed to look for snapshot: %w", err)
+ if !gc.skipNames && snapshotBuffer.Len() == 0 {
+ it, err := store.List(fmt.Sprintf("%s/snapshots/%s", gc.workspaceName, gc.name))
+ if err != nil {
+ return nil, fmt.Errorf("cannot create object iterator: %w", err)
+ }
+ if attrs, err := it.Next(); err != nil && errors.Is(err, storage.IteratorDone) {
+ return nil, fmt.Errorf("failed to look for snapshot")
} else if err == nil {
if _, err := it.Next(); err == nil {
return nil, fmt.Errorf("ambiguous snapshot name: %s", gc.name)
}
- snapshotAttrs = attrs
+ snapshotName = strings.TrimSuffix(path.Base(attrs.Path), ".json")
}
- }
-
- if snapshotAttrs == nil {
- return nil, fmt.Errorf("could not find tag or snapshot: %s", gc.name)
- }
- r, err := bucket.Object(snapshotAttrs.Name).NewReader(ctx)
- if err != nil {
- return nil, fmt.Errorf("failed to get resolved snapshot %s: %w", snapshotAttrs.Name, err)
+ _, err = store.ReadWithContext(ctx, fmt.Sprintf("%s/snapshots/%s.json", gc.workspaceName, snapshotName), snapshotBuffer)
+ if err != nil {
+ return nil, fmt.Errorf("cannot read the snapshot: %w", err)
+ }
}
- defer r.Close()
- snapshotBytes, err := ioutil.ReadAll(r)
- if err != nil {
- return nil, fmt.Errorf("failed to read snapshot: %w", err)
+ if snapshotBuffer.Len() == 0 {
+ return nil, fmt.Errorf("could not find tag or snapshot: %s", gc.name)
}
snapshot := &models.Snapshot{}
- if err := json.Unmarshal(snapshotBytes, snapshot); err != nil {
+ if err := json.Unmarshal(snapshotBuffer.Bytes(), snapshot); err != nil {
return nil, fmt.Errorf("snapshot format is invalid: %w", err)
}
diff --git a/snapshots/go/cmd/snapshots/push.go b/snapshots/go/cmd/snapshots/push.go
index 2f0bea08..7d0c9d5d 100644
--- a/snapshots/go/cmd/snapshots/push.go
+++ b/snapshots/go/cmd/snapshots/push.go
@@ -3,6 +3,7 @@
package main
import (
+ "bytes"
"context"
"encoding/json"
"fmt"
@@ -11,11 +12,12 @@ import (
"os"
"path"
- "cloud.google.com/go/storage"
flag "github.com/spf13/pflag"
+ "go.beyondstorage.io/v5/types"
"github.com/cognitedata/bazel-snapshots/snapshots/go/pkg/config"
"github.com/cognitedata/bazel-snapshots/snapshots/go/pkg/models"
+ "github.com/cognitedata/bazel-snapshots/snapshots/go/pkg/storage"
)
type pushConfig struct {
@@ -95,24 +97,24 @@ func runPush(args []string) error {
// log for debugging
log.Printf("name: %s", pc.name)
log.Printf("workspace: %s", pc.workspacePath)
- log.Printf("bucket: %s", pc.gcsBucket)
+ log.Printf("storage: %s", pc.storageURL)
obj, err := push(ctx, pc)
if err != nil {
return err
}
- objAttrs, err := obj.Attrs(ctx)
- if err != nil {
- log.Println("push successful but failed to get object attrs")
- } else {
- log.Printf("pushed snapshot of %d bytes: %s", objAttrs.Size, objAttrs.Name)
- }
+ contentLenght, isOk := obj.GetContentLength()
+ if !isOk {
+ log.Printf("failed to get contentLenght of pushed snapshot: %s", obj.Path)
+ }
+
+ log.Printf("pushed snapshot of %d bytes: %s", contentLenght, obj.Path)
return nil
}
-func push(ctx context.Context, pc *pushConfig) (*storage.ObjectHandle, error) {
+func push(ctx context.Context, pc *pushConfig) (*types.Object, error) {
if pc.snapshot == nil {
return nil, fmt.Errorf("no snapshot specified")
}
@@ -122,22 +124,21 @@ func push(ctx context.Context, pc *pushConfig) (*storage.ObjectHandle, error) {
return nil, fmt.Errorf("failed to marshal snapshot: %w", err)
}
- sclient, err := storage.NewClient(ctx)
+ store, err := storage.NewStorage(pc.storageURL)
if err != nil {
return nil, fmt.Errorf("failed to create storage client: %w", err)
}
- bucket := sclient.Bucket(pc.gcsBucket)
location := fmt.Sprintf("%s/snapshots/%s.json", pc.workspaceName, pc.name)
- obj := bucket.Object(location)
- w := obj.NewWriter(ctx)
- if _, err := w.Write(snapshotBytes); err != nil {
+ reader := bytes.NewReader(snapshotBytes)
+ if _, err := store.WriteWithContext(ctx, location, reader, int64(reader.Len())); err != nil {
return nil, fmt.Errorf("failed to write to bucket file: %w", err)
}
- if err := w.Close(); err != nil {
- return nil, fmt.Errorf("failed to close bucket file: %w", err)
- }
+ obj, err := store.StatWithContext(ctx, location)
+ if err != nil {
+ return nil, fmt.Errorf("failed to get object details: %w", err)
+ }
return obj, nil
}
diff --git a/snapshots/go/cmd/snapshots/snapshots.go b/snapshots/go/cmd/snapshots/snapshots.go
index faaaf37a..3a64b753 100644
--- a/snapshots/go/cmd/snapshots/snapshots.go
+++ b/snapshots/go/cmd/snapshots/snapshots.go
@@ -84,8 +84,8 @@ Snapshots may be run with one of the commands below.
digest - Create a digest of a set of files.
collect - Create a snapshot from all tracker files.
diff - Compute difference between two snapshots.
- get - Get a snapshot from the remote bucket.
- push - Push a snapshot to the remote bucket.
+ get - Get a snapshot from the remote storage.
+ push - Push a snapshot to the remote storage.
tag - Tag a remote snapshot.
help - Show this message
For usage information for a specific command, run the command with the -h flag.
diff --git a/snapshots/go/cmd/snapshots/tag.go b/snapshots/go/cmd/snapshots/tag.go
index b9e12b4c..0dfa56a2 100644
--- a/snapshots/go/cmd/snapshots/tag.go
+++ b/snapshots/go/cmd/snapshots/tag.go
@@ -3,6 +3,7 @@
package main
import (
+ "bytes"
"context"
"fmt"
"log"
@@ -10,10 +11,11 @@ import (
"path"
"strings"
- "cloud.google.com/go/storage"
flag "github.com/spf13/pflag"
+ "go.beyondstorage.io/v5/types"
"github.com/cognitedata/bazel-snapshots/snapshots/go/pkg/config"
+ "github.com/cognitedata/bazel-snapshots/snapshots/go/pkg/storage"
)
type tagConfig struct {
@@ -75,7 +77,7 @@ func runTag(args []string) error {
tc := getTagConfig(c)
log.Printf("workspace: %s", tc.workspacePath)
- log.Printf("bucket: %s", tc.gcsBucket)
+ log.Printf("storage: %s", tc.storageURL)
log.Printf("snapshot: %s", tc.snapshotName)
log.Printf("tag: %s", tc.tagName)
@@ -84,46 +86,38 @@ func runTag(args []string) error {
return err
}
- objAttrs, err := obj.Attrs(ctx)
- if err != nil {
- log.Println("tag successful but failed to get the object attrs")
- } else {
- log.Printf("tagged snapshot %s as %s: %s", tc.snapshotName, tc.tagName, objAttrs.Name)
- }
+ log.Printf("tagged snapshot %s as %s: %s", tc.snapshotName, tc.tagName, obj.Path)
return nil
}
-func tag(ctx context.Context, tc *tagConfig) (*storage.ObjectHandle, error) {
- sclient, err := storage.NewClient(ctx)
+func tag(ctx context.Context, tc *tagConfig) (*types.Object, error) {
+ store, err := storage.NewStorage(tc.storageURL)
if err != nil {
return nil, fmt.Errorf("failed to create storage client: %w", err)
}
- bucket := sclient.Bucket(tc.gcsBucket)
snapshotLocation := fmt.Sprintf("%s/snapshots/%s.json", tc.workspaceName, tc.snapshotName)
- snapObjAttrs, err := bucket.Object(snapshotLocation).Attrs(ctx)
+ attrs, err := store.StatWithContext(ctx, snapshotLocation)
if err != nil {
- if err == storage.ErrObjectNotExist {
- return nil, fmt.Errorf("no such snapshot in bucket: %s", tc.snapshotName)
- }
return nil, fmt.Errorf("failed to get snapshot: %w", err)
}
- tagContent := strings.TrimSuffix(path.Base(snapObjAttrs.Name), ".json")
-
+ tagContent := []byte(strings.TrimSuffix(path.Base(attrs.Path), ".json"))
tagLocation := fmt.Sprintf("%s/tags/%s", tc.workspaceName, tc.tagName)
- tagObj := bucket.Object(tagLocation)
- tagWriter := tagObj.NewWriter(ctx)
- if _, err := fmt.Fprintf(tagWriter, tagContent); err != nil {
+ reader := bytes.NewReader(tagContent)
+
+ if _, err := store.WriteWithContext(ctx, tagLocation, reader, int64(reader.Len())); err != nil {
return nil, fmt.Errorf("failed to write tag: %w", err)
}
- if err := tagWriter.Close(); err != nil {
- return nil, fmt.Errorf("failed to close tag file: %w", err)
+
+ obj, err := store.StatWithContext(ctx, tagLocation)
+ if err != nil {
+ return nil, fmt.Errorf("failed to get object details: %w", err)
}
- return tagObj, nil
+ return obj, nil
}
func tagUsage(fs *flag.FlagSet) {
diff --git a/snapshots/go/pkg/storage/BUILD.bazel b/snapshots/go/pkg/storage/BUILD.bazel
new file mode 100644
index 00000000..2cbbad8d
--- /dev/null
+++ b/snapshots/go/pkg/storage/BUILD.bazel
@@ -0,0 +1,13 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "storage",
+ srcs = ["storage.go"],
+ importpath = "github.com/cognitedata/bazel-snapshots/snapshots/go/pkg/storage",
+ visibility = ["//visibility:public"],
+ deps = [
+ "@io_beyondstorage_go_services_gcs_v3//:gcs",
+ "@io_beyondstorage_go_v5//services",
+ "@io_beyondstorage_go_v5//types",
+ ],
+)
diff --git a/snapshots/go/pkg/storage/storage.go b/snapshots/go/pkg/storage/storage.go
new file mode 100644
index 00000000..9e27f8a0
--- /dev/null
+++ b/snapshots/go/pkg/storage/storage.go
@@ -0,0 +1,15 @@
+/* Copyright 2022 Cognite AS */
+
+package storage
+
+import (
+ _ "go.beyondstorage.io/services/gcs/v3"
+ "go.beyondstorage.io/v5/services"
+ "go.beyondstorage.io/v5/types"
+)
+
+var IteratorDone = types.IterateDone
+
+func NewStorage(storageUrl string) (types.Storager, error) {
+ return services.NewStoragerFromString(storageUrl)
+}
diff --git a/snapshots/snapshots.bzl b/snapshots/snapshots.bzl
index 94c632c8..414bc444 100644
--- a/snapshots/snapshots.bzl
+++ b/snapshots/snapshots.bzl
@@ -104,8 +104,8 @@ def change_tracker(name, **kwargs):
def _snapshots_runner_impl(ctx):
args = []
- args.extend(["--gcs-bucket", ctx.attr.bucket])
args.extend(["--workspace-name", ctx.workspace_name])
+ args.extend(["--storage-url", ctx.attr.storage])
out_file = ctx.actions.declare_file(ctx.label.name + ".bash")
substitutions = {
@@ -140,8 +140,8 @@ _snapshots_runner = rule(
executable = True,
allow_single_file = True,
),
- "bucket": attr.string(
- doc = "Name of the bucket to use (optional)",
+ "storage": attr.string(
+ doc = "Full URL of the bucket",
),
"_template": attr.label(
default = "//snapshots:runner.tmpl.sh",